From 9d2960db7aeb503bd73678828dea40aaf0f3b9a7 Mon Sep 17 00:00:00 2001 From: Daniel Schadt Date: Thu, 16 Jun 2022 20:33:58 +0200 Subject: nvim: small updates to LSP config --- neovim/.config/nvim/init.vim | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'neovim/.config/nvim') diff --git a/neovim/.config/nvim/init.vim b/neovim/.config/nvim/init.vim index 1f5e149..e764ba2 100644 --- a/neovim/.config/nvim/init.vim +++ b/neovim/.config/nvim/init.vim @@ -140,6 +140,16 @@ Plug 'ryanoasis/vim-devicons' call plug#end() lua << EOF +-- Override the weird Class & Struct icons, which usually resolve to a +-- "mathcal"-Style letter +vim.g.symbols_outline = { + width = 30, + symbols = { + Class = {icon = "", hl = "TSType"}, + Struct = {icon = "﬘", hl = "TSType"}, + } +} + -- Setup LSP status to display the number of diagnostics in the statusbar local lsp_status = require('lsp-status') local kind_labels_mt = {__index = function(_, k) return k end} @@ -179,6 +189,8 @@ cmp.setup({ c = cmp.mapping.close(), }), [''] = cmp.mapping.confirm({ select = true }), + [''] = cmp.mapping(cmp.mapping.select_next_item()), + [''] = cmp.mapping(cmp.mapping.select_prev_item()), }, sources = cmp.config.sources({ { name = 'nvim_lsp' }, @@ -195,6 +207,7 @@ vim.api.nvim_set_keymap('n', 'e', 'lua vim.diagnostic.open_float()lua vim.diagnostic.goto_prev()', opts) vim.api.nvim_set_keymap('n', ']d', 'lua vim.diagnostic.goto_next()', opts) vim.api.nvim_set_keymap('n', 'q', 'lua vim.diagnostic.setloclist()', opts) +vim.api.nvim_set_keymap('v', '\\qf', 'lua vim.lsp.buf.range_formatting()', opts) -- Use an on_attach function to only map the following keys -- after the language server attaches to the current buffer @@ -226,7 +239,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', 'pylsp' } +local servers = { 'clangd', 'hls', 'rust_analyzer', 'texlab', 'jedi_language_server', 'tsserver' } for _, lsp in ipairs(servers) do local config = { on_attach = on_attach, -- cgit v1.2.3