diff options
| Commit | a1925f409fd2f1af21ffa778ae6bbaa53cc57162 (patch) | |
|---|---|---|
| Author | 2024-11-05 13:07:42 +0200 | |
| Committer | 2024-11-05 13:07:42 +0200 | |
| Files | 0c21c3be7ced3a2aabfca1b2c0c1eaa823b31eb9 /lua/plugins | |
| anderson-a1925f409fd2f1af21ffa778ae6bbaa53cc57162.tar anderson-a1925f409fd2f1af21ffa778ae6bbaa53cc57162.tar.gz anderson-a1925f409fd2f1af21ffa778ae6bbaa53cc57162.zip | ||
| Parent | 31e5a8ab1c82671c2782c6bfae1fe01da7fea719 (diff) | |
feat(lsp): Configure rust-analyzer
1 files changed, 11 insertions, 4 deletions
| -rw-r--r-- | lua/plugins/lsp.lua | 15 |
diff --git a/lua/plugins/lsp.lua b/lua/plugins/lsp.lua index b6aa40b..cf2ca66 100644 --- a/lua/plugins/lsp.lua +++ b/lua/plugins/lsp.lua @@ -31,9 +31,10 @@ return { dependencies = { 'VonHeikemen/lsp-zero.nvim', 'williamboman/mason-lspconfig.nvim' }, lazy = false, opts = { -- :h lspconfig-all - awk_ls = { }, + -- awk_ls = { }, bashls = { }, lua_ls = { }, + rust_analyzer = { }, }, config = function(_, opts) for k,v in pairs(opts) do @@ -87,8 +88,8 @@ return { opts = { sign_text = true, capabailities = "", - lsp_attach = function(client, bufnr) - local opts = {buffer = bufnr} + lsp_attach = function(event) + local opts = { silent = true, buffer = event.buf } vim.keymap.set('n', 'K', '<cmd>lua vim.lsp.buf.hover()<cr>', opts) vim.keymap.set('n', 'gd', '<cmd>lua vim.lsp.buf.definition()<cr>', opts) @@ -104,6 +105,10 @@ return { }, config = function(_, opts) opts.capabilities = require('cmp_nvim_lsp').default_capabilities() + vim.api.nvim_create_autocmd('LspAttach', { + desc = 'Lsp Actions', + callback = opts.lsp_attach, + }) require("lsp-zero").extend_lspconfig(opts) end, }, @@ -124,6 +129,8 @@ return { { 'williamboman/mason.nvim', lazy = false, - config = true, + opts = { + PATH = "append", + }, }, } |
