summaryrefslogtreecommitdiff
path: root/.config/nvim/lua/setup/lspconfig.lua
diff options
context:
space:
mode:
authorAdam <56338480+adastx@users.noreply.github.com>2022-05-03 00:02:49 +0200
committerAdam <56338480+adastx@users.noreply.github.com>2022-05-03 00:32:10 +0200
commit88fce742fea734e6ad9fd3716e3f64161138926b (patch)
tree57e40051432a12b9a6372df110fc7e190642a5ff /.config/nvim/lua/setup/lspconfig.lua
parent0e19499ddeb4ac32ef208aae658214b41148cd6c (diff)
nvim: bufferline, nvim-tree, lsp, telescope, lualine
Diffstat (limited to '.config/nvim/lua/setup/lspconfig.lua')
-rw-r--r--.config/nvim/lua/setup/lspconfig.lua30
1 files changed, 30 insertions, 0 deletions
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! * <buffer>')
+ vim.cmd('autocmd BufWritePre <buffer> 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