not quite sure what I've done here

This commit is contained in:
Squibid 2025-11-22 17:22:23 -05:00
parent b22873f45f
commit 83aaa5aef3
Signed by: squibid
GPG key ID: BECE5684D3C4005D
18 changed files with 392 additions and 392 deletions

View file

@ -3,9 +3,9 @@ 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),
"n", true)
vim.api.nvim_feedkeys(
vim.api.nvim_replace_termcodes(keys, true, false, true),
"n", true)
end
-- vim binds
@ -27,27 +27,27 @@ map("n", "<C-i>", lz "<C-i>zz")
-- trigger completion menu
-- (stolen from https://gist.github.com/MariaSolOs/2e44a86f569323c478e5a078d0cf98cc)
map("i", "<C-n>", function()
-- if the completion menu is already visible just go to the next item
if vim.fn.pumvisible() ~= 0 then
feedkeys("<C-n>")
else
if #vim.lsp.get_clients({ bufnr = 0 }) > 0 then
vim.lsp.completion.get()
else
if vim.bo.omnifunc == "" then
feedkeys("<C-x><C-n>")
else
feedkeys("<C-x><C-o>")
end
end
end
-- if the completion menu is already visible just go to the next item
if vim.fn.pumvisible() ~= 0 then
feedkeys("<C-n>")
else
if #vim.lsp.get_clients({ bufnr = 0 }) > 0 then
vim.lsp.completion.get()
else
if vim.bo.omnifunc == "" then
feedkeys("<C-x><C-n>")
else
feedkeys("<C-x><C-o>")
end
end
end
end, { desc = "Trigger/select next completion" })
map("i", "<CR>", function()
if vim.fn.pumvisible() ~= 0 then
feedkeys("<C-e><CR>")
else
feedkeys("<CR>")
end
if vim.fn.pumvisible() ~= 0 then
feedkeys("<C-e><CR>")
else
feedkeys("<CR>")
end
end, { desc = "prevent omnifunc from completing on <CR>" })
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" })
@ -57,9 +57,9 @@ map("n", "<M-j>", lz "<cmd>cnext<CR>zz", { desc = "qf next" })
map("n", "<M-k>", lz "<cmd>cprev<CR>zz", { desc = "qf prev" })
map("n", "<M-c>", "<cmd>cclose<CR>", { desc = "qf close" })
map("n", "<M-x>", lz(function()
local win = vim.api.nvim_get_current_win()
vim.cmd.cope()
vim.api.nvim_set_current_win(win)
local win = vim.api.nvim_get_current_win()
vim.cmd.cope()
vim.api.nvim_set_current_win(win)
end), { desc = "qf open" })
-- man pages