diff options
| author | kkard2 <[email protected]> | 2023-07-30 22:13:49 +0200 |
|---|---|---|
| committer | kkard2 <[email protected]> | 2023-07-30 22:13:49 +0200 |
| commit | 4c1b83a9cf7c3708a8e95c8c5978768177c7f1b1 (patch) | |
| tree | 5c1cc45addf6c47af2660d6ebcecd5f53a062a9f /nvim/lua/kkard2/lazy | |
| parent | 641cfd630c04de47248212fa6bd86edb449c2ad0 (diff) | |
mostly done nvim i think?
Diffstat (limited to 'nvim/lua/kkard2/lazy')
| -rw-r--r-- | nvim/lua/kkard2/lazy/lsp.lua | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/nvim/lua/kkard2/lazy/lsp.lua b/nvim/lua/kkard2/lazy/lsp.lua new file mode 100644 index 0000000..08d22d1 --- /dev/null +++ b/nvim/lua/kkard2/lazy/lsp.lua @@ -0,0 +1,19 @@ +return function() + local lsp = require("lsp-zero").preset({}) + + lsp.on_attach(function(_, bufnr) + -- see :help lsp-zero-keybindings + -- to learn the available actions + lsp.default_keymaps({ buffer = bufnr }) + end) + + -- (Optional) Configure lua language server for neovim + require("lspconfig").lua_ls.setup(lsp.nvim_lua_ls()) + + lsp.setup() + + vim.keymap.set("n", "gh", vim.diagnostic.open_float) + vim.keymap.set("n", "<leader>lr", vim.lsp.buf.rename) + vim.keymap.set("n", "<leader><CR>", vim.lsp.buf.code_action) + vim.keymap.set("n", "<leader>lf", vim.lsp.buf.format) +end |
