From 88fce742fea734e6ad9fd3716e3f64161138926b Mon Sep 17 00:00:00 2001 From: Adam <56338480+adastx@users.noreply.github.com> Date: Tue, 3 May 2022 00:02:49 +0200 Subject: nvim: bufferline, nvim-tree, lsp, telescope, lualine --- .config/nvim/lua/setup/lspconfig.lua | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 .config/nvim/lua/setup/lspconfig.lua (limited to '.config/nvim/lua/setup/lspconfig.lua') diff --git a/.config/nvim/lua/setup/lspconfig.lua b/.config/nvim/lua/setup/lspconfig.lua new file mode 100644 index 0000000..47fd84a --- /dev/null +++ b/.config/nvim/lua/setup/lspconfig.lua @@ -0,0 +1,30 @@ +require("nvim-lsp-installer").setup {} +local lspconfig = require("lspconfig") + +local function on_attach() + vim.cmd('doautocmd User lspAttached') + vim.cmd('augroup Format') + vim.cmd('autocmd! * ') + vim.cmd('autocmd BufWritePre lua vim.lsp.buf.formatting_sync()') + vim.cmd('augroup END') +end + +lspconfig.sumneko_lua.setup { + on_attach = on_attach, + settings = { + Lua = { + diagnostics = { + globals = { 'vim' } + } + } + } +} +lspconfig.rust_analyzer.setup { + on_attach = on_attach, +} + +local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } +for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) +end -- cgit v1.2.3-70-g09d2