aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/plugins/lsp.lua
diff options
context:
space:
mode:
Diffstat (limited to '.config/nvim/lua/plugins/lsp.lua')
-rw-r--r--.config/nvim/lua/plugins/lsp.lua56
1 files changed, 56 insertions, 0 deletions
diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua
new file mode 100644
index 0000000..3f691d6
--- /dev/null
+++ b/.config/nvim/lua/plugins/lsp.lua
@@ -0,0 +1,56 @@
+return {
+ {
+ "williamboman/mason.nvim",
+ lazy = false,
+ config = function()
+ require("mason").setup()
+ end,
+ },
+ {
+ "williamboman/mason-lspconfig.nvim",
+ lazy = false,
+ opts = {
+ auto_install = true,
+ ensure_installed = { "helm_ls", "dockerls" },
+ },
+ },
+ {
+ "neovim/nvim-lspconfig",
+ lazy = false,
+ config = function()
+ local capabilities = require('cmp_nvim_lsp').default_capabilities()
+
+ vim.lsp.enable({
+ "lua_ls", "clangd", "rust_analyzer", "bashls",
+ "html", "cssls", "jsonls", "helm_ls", "yamlls",
+ "dockerfile-language-server"
+ })
+
+ vim.lsp.config("*", {
+ capabilities = capabilities
+ })
+
+ vim.diagnostic.config({
+ virtual_text = {
+ prefix = '',
+ spacing = 4,
+ },
+ signs = {
+ text = {
+ [vim.diagnostic.severity.ERROR] = '',
+ [vim.diagnostic.severity.WARN] = '',
+ },
+ },
+ underline = true,
+ update_in_insert = true,
+ severity_sort = true,
+ })
+
+ vim.keymap.set('n', '<leader>lf', vim.lsp.buf.format)
+ -- vim.keymap.set("n", "K", vim.lsp.buf.hover, {})
+ -- vim.keymap.set("n", "<leader>gd", vim.lsp.buf.definition, {})
+ -- vim.keymap.set("n", "<leader>gr", vim.lsp.buf.references, {})
+ -- vim.keymap.set("n", "<leader>ca", vim.lsp.buf.code_action, {})
+ end,
+ },
+}