Skip to content

Commit

Permalink
neovim: Add LSP settings
Browse files Browse the repository at this point in the history
  • Loading branch information
m-b-t-n committed Jan 28, 2025
1 parent 66ef92b commit 8960267
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions neovim/lua/plugins/lsp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
local lsp_servers = {
"bashls",
"lua_ls",
}

return {
{
"williamboman/mason.nvim",
dependencies = {
"williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
},
config = function()
require("mason").setup()
require("mason-lspconfig").setup({
ensure_installed = lsp_servers,
})
local lsp_config = require("lspconfig")
for _, lsp_server in ipairs(lsp_servers) do
lsp_config[lsp_server].setup({
root_dir = function(fname)
return lsp_config.util.find_git_ancestor(fname) or vim.fn.getcwd()
end,
})
end
end,
},
}

0 comments on commit 8960267

Please sign in to comment.