diff options
| -rw-r--r-- | neovim/.config/nvim/init.vim | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/neovim/.config/nvim/init.vim b/neovim/.config/nvim/init.vim index c202106..bda465b 100644 --- a/neovim/.config/nvim/init.vim +++ b/neovim/.config/nvim/init.vim @@ -39,6 +39,8 @@ Plug 'ntpeters/vim-better-whitespace' " Nice support for latex files Plug 'lervag/vimtex' +" Nice support for rST files +Plug 'habamax/vim-rst' " Override configs by directory Plug 'arielrossanigo/dir-configs-override.vim' @@ -76,8 +78,6 @@ Plug 'neomake/neomake' " Pre-built configurations for the neovim LSP client Plug 'neovim/nvim-lspconfig' -" Allow for better project-local settings -Plug 'tamago324/nlsp-settings.nvim', {'branch' : 'main'} " List all symbols in the file Plug 'simrat39/symbols-outline.nvim' @@ -131,7 +131,7 @@ Plug 'myusuf3/numbers.vim' " Official rust plugin Plug 'rust-lang/rust.vim' -Plug 'simrat39/rust-tools.nvim' +Plug 'mrcjkb/rustaceanvim' " Trouble diagnostics display Plug 'folke/lsp-colors.nvim', {'branch': 'main'} @@ -146,6 +146,8 @@ Plug 'ryanoasis/vim-devicons' call plug#end() lua << EOF +require('trouble').setup() + require('symbols-outline').setup({ -- Override the weird Class & Struct icons, which usually resolve to a -- "mathcal"-Style letter @@ -172,17 +174,6 @@ lsp_status.config({ status_symbol = "", }) --- Set up per-project LSP settings. Place them in the --- .nlsp-settings/<langserver>.json --- file, or use --- :LspSettings local <langserver> -require("nlspsettings").setup({ - config_home = vim.fn.stdpath('config') .. '/nlsp-settings', - local_settings_dir = ".nlsp-settings", - local_settings_root_markers_fallback = { '.git' }, - append_default_schemas = true, - loader = 'json', -}) -- Setup nvim-cmp. local cmp = require'cmp' @@ -217,15 +208,11 @@ cmp.setup({ }) }) --- Setup the actual language servers -local nvim_lsp = require('lspconfig') - local opts = { noremap=true, silent=true } vim.api.nvim_set_keymap('n', '<space>e', '<cmd>lua vim.diagnostic.open_float()<CR>', opts) vim.api.nvim_set_keymap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts) vim.api.nvim_set_keymap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts) vim.api.nvim_set_keymap('n', '<space>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', opts) -vim.api.nvim_set_keymap('v', '\\qf', '<ESC><cmd>lua vim.lsp.buf.format({ async = true })<CR>', opts) -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer @@ -257,7 +244,7 @@ end -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches -local servers = { 'clangd', 'hls', 'rust_analyzer', 'texlab', 'jedi_language_server', 'tsserver' } +local servers = { 'clangd', 'hls', 'rust_analyzer', 'texlab', 'jedi_language_server', 'ts_ls' } for _, lsp in ipairs(servers) do local config = { on_attach = on_attach, @@ -269,10 +256,10 @@ for _, lsp in ipairs(servers) do if lsp == 'pylsp' then config['settings'] = {pylsp = {plugins = {pylint = {enabled = true}}}} end - if lsp == 'rust_analyzer' then - require('rust-tools').setup({server = config}) - else - nvim_lsp[lsp].setup(config) + -- rust_analyzer does not require .setup + if lsp ~= 'rust_analyzer' then + vim.lsp.config(lsp, config) + vim.lsp.enable(lsp) end end @@ -281,8 +268,8 @@ EOF nmap <F2> :TagbarToggle<CR> nmap <silent><space>s :SymbolsOutline<CR> nmap <F4> :SymbolsOutline<CR> -nmap <F5> :TroubleToggle workspace_diagnostics<CR> -nmap <F6> :TroubleToggle document_diagnostics<CR> +nmap <F5> :Trouble diagnostics toggle<CR> +nmap <F6> :Trouble diagnostics toggle filter.buf=0<CR> function! LspStatus() abort return trim(luaeval("require('lsp-status').status()")) |
