diff options
author | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2024-06-07 00:29:15 +0300 |
---|---|---|
committer | Yaroslav de la Peña Smirnov <yps@yaroslavps.com> | 2024-06-07 00:29:15 +0300 |
commit | a4f25f1850bb92c85206ba8e4c61ec0121f5020f (patch) | |
tree | 59ae0ee560d510fdabcd6b680f72b5a1e4809e9b /dotfiles/.config/nvim/lua.lua | |
parent | 3424b7a3bf10ab271dd6c88b07846b0400f66d87 (diff) | |
download | vimrice-a4f25f1850bb92c85206ba8e4c61ec0121f5020f.tar.gz vimrice-a4f25f1850bb92c85206ba8e4c61ec0121f5020f.zip |
lsp: set icons and organize config
* Set icons for LSP diagnostics and completion.
* Move the lua part of the config into a different file.
Diffstat (limited to 'dotfiles/.config/nvim/lua.lua')
-rw-r--r-- | dotfiles/.config/nvim/lua.lua | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/dotfiles/.config/nvim/lua.lua b/dotfiles/.config/nvim/lua.lua new file mode 100644 index 0000000..8514d19 --- /dev/null +++ b/dotfiles/.config/nvim/lua.lua @@ -0,0 +1,49 @@ +-- LSP configuration + +local lspconfig = require('lspconfig') + +lspconfig.clangd.setup{filetypes = { "c", "cpp", "objc", "objcpp", "ch" }} +lspconfig.gopls.setup{} +lspconfig.pylsp.setup{} +lspconfig.rls.setup{} +lspconfig.quick_lint_js.setup{} +require('lspfuzzy').setup{} + +local lsp_icons = { + Class = " ", + Color = " ", + Constant = " ", + Constructor = " ", + Enum = " ", + EnumMember = " ", + Field = " ", + File = " ", + Folder = " ", + Function = "ƒ ", + Interface = "", + Keyword = " ", + Method = "∫ ", + Module = " ", + Property = " ", + Snippet = " ", + Struct = " ", + Text = " ", + Unit = " ", + Value = " ", + Variable = " ", +} + + +function lsp_icons_setup() + local kinds = vim.lsp.protocol.CompletionItemKind + for i, kind in ipairs(kinds) do + kinds[i] = lsp_icons[kind] or kind + end +end + +lsp_icons_setup() + +vim.fn.sign_define('DiagnosticSignError', { text = '', texthl = 'DiagnosticSignError' }) +vim.fn.sign_define('DiagnosticSignWarn', { text = '', texthl = 'DiagnosticSignWarn' }) +vim.fn.sign_define('DiagnosticSignInfo', { text = '', texthl = 'DiagnosticSignInfo' }) +vim.fn.sign_define('DiagnosticSignHint', { text = '', texthl = 'DiagnosticSignHint' }) |