nvim: add lsp support for rust and typescript

This commit is contained in:
Oshgnacknak 2025-06-26 15:21:44 +02:00
parent 4911861557
commit 7c3c38903c
Signed by: Oshgnacknak
GPG key ID: 8CB7375654585956
3 changed files with 15 additions and 3 deletions

View file

@ -29,13 +29,10 @@ cmp.setup({
} }
}) })
<<<<<<< HEAD
=======
lsp.ensure_installed({ lsp.ensure_installed({
'ts_ls', 'ts_ls',
}) })
>>>>>>> ca495fe (nvim: Better typescript support)
local null_ls = require('null-ls') local null_ls = require('null-ls')
local null_opts = lsp.build_options('null-ls', {}) local null_opts = lsp.build_options('null-ls', {})

View file

@ -0,0 +1,13 @@
local rt = require("rust-tools")
rt.setup({
server = {
on_attach = function(_, bufnr)
-- Hover actions
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
-- Code action groups
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
end,
},
})

View file

@ -33,4 +33,6 @@ Plug 'hrsh7th/cmp-nvim-lsp'
Plug 'L3MON4D3/LuaSnip' Plug 'L3MON4D3/LuaSnip'
Plug 'VonHeikemen/lsp-zero.nvim', {'branch': 'v2.x'} Plug 'VonHeikemen/lsp-zero.nvim', {'branch': 'v2.x'}
Plug 'simrat39/rust-tools.nvim'
call plug#end() call plug#end()