From 799c3ed55e82e8e989cfaaedf02b761aa139ecc9 Mon Sep 17 00:00:00 2001 From: kkard2 Date: Sun, 28 Apr 2024 12:13:02 +0200 Subject: lsp fixes --- nvim/init.lua | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/nvim/init.lua b/nvim/init.lua index dc94ce4..ed7fdb8 100644 --- a/nvim/init.lua +++ b/nvim/init.lua @@ -35,6 +35,8 @@ vim.api.nvim_create_autocmd({"BufEnter"}, { vim.g.netrw_bufsettings = "noma nomod nu nobl nowrap ro" vim.g.netrw_banner = 0 +vim.g.zig_fmt_autosave = 0 -- this is pretty annoying + vim.opt.signcolumn = "yes" vim.opt.list = true @@ -260,6 +262,7 @@ require("lazy").setup({ map("]d", vim.diagnostic.goto_prev, "Prev [D]iagnostic") map("lr", vim.lsp.buf.rename, "[L]SP [R]ename") + map("lf", vim.lsp.buf.format, "[L]SP [F]ormat") map("", vim.lsp.buf.code_action, "Code Action") map("K", vim.lsp.buf.hover, "Hover Documentation") map("gD", vim.lsp.buf.declaration, "[G]oto [D]eclaration") @@ -324,17 +327,17 @@ require("lazy").setup({ [""] = cmp.mapping.select_next_item(), [""] = cmp.mapping.select_prev_item(), [""] = cmp.mapping.confirm({ select = true }), + [""] = cmp.mapping(function() + if luasnip.expand_or_locally_jumpable() then + luasnip.expand_or_jump() + end + end, { "i", "s" }), + [""] = cmp.mapping(function() + if luasnip.locally_jumpable(-1) then + luasnip.jump(-1) + end + end, { "i", "s" }), }), - [""] = cmp.mapping(function() - if luasnip.expand_or_locally_jumpable() then - luasnip.expand_or_jump() - end - end, { "i", "s" }), - [""] = cmp.mapping(function() - if luasnip.locally_jumpable(-1) then - luasnip.jump(-1) - end - end, { "i", "s" }), }) end -- cgit v1.3.1