I'm not gonna bother

This commit is contained in:
2025-08-10 13:10:05 -04:00
parent 7c96b43098
commit d320577772
18 changed files with 182 additions and 192 deletions

View File

@ -1,4 +1,7 @@
local map, lz = core.misc.map, core.misc.lz
--- feed keys as userinput
---@param keys string keys
local function feedkeys(keys)
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes(keys, true, false, true),
@ -9,7 +12,8 @@ end
vim.g.mapleader = " " -- set leader key
map("x", "<leader>p", [["_dP]], { desc = "Greatest remap of all time." })
map("n", "<esc>", ":nohlsearch<Bar>:echo<CR>", { desc = "Clear search." })
map("n", "<esc>", "<cmd>noh<Bar>:ec<CR>", { desc = "Clear search." })
map("n", "<leader>a", lz "<cmd>e #<CR>zz", { desc = "swap to alt file" })
-- the cursor STAYS IN THE MIDDLE
map("n", "<S-j>", lz "mzJ`z<cmd>delm z<CR>") -- when combining lines
@ -17,6 +21,8 @@ map("n", "n", lz "nzzzv") -- when searching
map("n", "N", lz "Nzzzv")
map("n", "<C-d>", lz "<C-d>zz") -- half page jumping
map("n", "<C-u>", lz "<C-u>zz")
map("n", "<C-o>", lz "<C-o>zz") -- jump history
map("n", "<C-i>", lz "<C-i>zz")
-- trigger completion menu
-- (stolen from https://gist.github.com/MariaSolOs/2e44a86f569323c478e5a078d0cf98cc)
@ -40,10 +46,20 @@ map("i", "<C-s>", "<C-x><C-s>", { desc = "Trigger spell completion" })
map("n", "<C-s>", lz "<cmd>se spell<CR>ea<C-x><C-s><cmd>se nospell<CR>", { desc = "Trigger spell completion" })
-- quickfix
map("n", "<M-j>", "<cmd>cnext<CR>")
map("n", "<M-k>", "<cmd>cprev<CR>")
map("n", "<M-c>", "<cmd>cclose<CR>")
map("n", "<M-x>", "<cmd>cope<CR>")
map("n", "<M-j>", "<cmd>cnext<CR>", { desc = "qf next" })
map("n", "<M-k>", "<cmd>cprev<CR>", { desc = "qf prev" })
map("n", "<M-c>", "<cmd>cclose<CR>", { desc = "qf close" })
map("n", "<M-x>", "<cmd>cope<CR>", { desc = "qf open" })
-- man pages
map("n", "<C-k>", "<cmd>Man<CR>")
-- okay this is gonna sound crazy, but I like emacs binds for editing when I'm
-- stuck without modal editing like in command mode.
map("c", "<C-a>", function() feedkeys("<Home>") end)
map("c", "<C-e>", function() feedkeys("<End>") end)
map("c", "<C-d>", function() feedkeys("<Del>") end)
-- execute line/block
map("n", "<leader>x", ":.lua<CR>")
map("x", "<leader>x", ":lua<CR>")

View File

@ -29,6 +29,9 @@ vim.o.udf = true
-- searching
vim.o.ic = true
-- make windows look nice
vim.o.winborder = "solid"
-- wild menus
vim.o.ph = 20
vim.o.wic = true
@ -37,9 +40,8 @@ vim.o.wop = "fuzzy,pum,tagfile"
-- completion
vim.o.cot = "menu,menuone,noinsert,fuzzy,popup"
vim.o.cia = "kind,abbr,menu"
-- make windows look nice
vim.o.winborder = "solid"
-- waiting for https://github.com/neovim/neovim/pull/25541 to land
-- vim.o.completepopup = "border:"..vim.o.winborder
do -- statusline
---@return string out formatted status line

View File

@ -1,32 +1,8 @@
local nonels_augroup = core.misc.augroup("nullls formatting")
return {
{ "neovim/nvim-lspconfig",
reqs = {
"mason-org/mason.nvim",
"mason-org/mason-lspconfig.nvim"
},
load = function()
core.lsp.setup()
require("mason-lspconfig").setup {
ensure_added = {
"clangd",
"mesonlsp",
"bashls",
"jdtls",
"lua_ls",
-- python
"basedpyright",
"black",
"debugpy"
}
}
end
},
{ "mason-org/mason.nvim",
reqs = "neovim/nvim-lspconfig",
load = function()
require("mason").setup {
ui = {
@ -38,6 +14,8 @@ return {
}
}
}
core.mason.ensure_installed()
end
},

View File

@ -10,9 +10,13 @@ return { "L3MON4D3/LuaSnip",
load:keymap({"i", "s"}, "<c-e>")
load:keymap({"i", "s"}, "<c-j>")
load:keymap({"i", "s"}, "<c-k>")
load:auto("InsertEnter")
end,
load = function()
local ls = require("luasnip")
-- replace the builtin snippet handler with luasnip so I get all my fancy
-- stuff
vim.snippet.expand = ls.lsp_expand
ls.config.setup {

View File

@ -151,5 +151,7 @@ return { "nvim-telescope/telescope.nvim",
cwd = vim.fs.joinpath(vim.fn.stdpath("data"), "site/pack/deps/opt")
}
end, { desc = "find files in plugin directory" })
map("n", "<leader>tt", "<cmd>Telescope<CR>")
end
}

View File

@ -71,7 +71,7 @@ return {
{ "windwp/nvim-ts-autotag",
reqs = "nvim-treesitter/nvim-treesitter",
disable = not vim.fn.has("nvim-0.9.5"),
disable = true,
-- lazy = dep_short.auto({ "BufReadPre", "BufNewFile" }),
load = function()
require("nvim-ts-autotag").setup {}