aboutsummaryrefslogtreecommitdiff
path: root/.config/nvim/lua/plugins/lsp.lua
diff options
context:
space:
mode:
authorawy <awy@awy.one>2025-11-16 18:12:11 +0300
committerawy <awy@awy.one>2025-11-16 18:12:11 +0300
commitad205a6812ddbcfb73c73a7e6b7a9acbb5267d53 (patch)
treec739bcc0093648db96ea3f7d743c486691139d53 /.config/nvim/lua/plugins/lsp.lua
parent5764990192e805fe32743dc311813ac8b396e8b2 (diff)
downloadmangoslice-ad205a6812ddbcfb73c73a7e6b7a9acbb5267d53.tar.gz
nvim
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,
+ },
+}