-- LSP configuration local lspconfig = require('lspconfig') local on_attach = function(client, _) client.request = require('lspfuzzy').wrap_request(client.request) end vim.lsp.config('*', {on_attach = on_attach}) vim.lsp.config('clangd', { on_attach = on_attach, filetypes = { "c", "cpp", "objc", "objcpp", "ch" }, init_options = { fallbackFlags = { } }, }) vim.lsp.enable('clangd') vim.lsp.enable('gopls') vim.lsp.enable('pylsp') vim.lsp.enable('rust_analyzer') vim.lsp.enable('quick_lint_js') vim.lsp.enable('zls') 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() if vim.fn.has('nvim-0.11') then vim.diagnostic.config({ signs = { text = { [vim.diagnostic.severity.ERROR] = '', [vim.diagnostic.severity.WARN] = '', [vim.diagnostic.severity.INFO] = '', [vim.diagnostic.severity.HINT] = '', }, } }) else 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' }) end