Compare commits

..

3 commits

3 changed files with 50 additions and 6 deletions

View file

@ -3,4 +3,7 @@ return {
branch = "main", branch = "main",
--event = "VeryLazy", --event = "VeryLazy",
opts = {}, opts = {},
dependencies = {
"nvim-tree/nvim-web-devicons",
},
} }

View file

@ -1,7 +1,7 @@
return { return {
{ {
"VonHeikemen/lsp-zero.nvim", "VonHeikemen/lsp-zero.nvim",
branch = "v3.x", branch = "v4.x",
lazy = true, lazy = true,
config = false, config = false,
init = function() init = function()
@ -90,15 +90,21 @@ return {
}) })
-- This is where all the LSP shenanigans will live -- This is where all the LSP shenanigans will live
local lsp_zero = require("lsp-zero") local lsp_zero = require("lsp-zero")
lsp_zero.extend_lspconfig()
-- Keybindings only active when a LS is active for the curr. file -- Keybindings only active when a LS is active for the curr. file
lsp_zero.on_attach(function(client, bufnr) -- lsp_zero.on_attach(function(client, bufnr)
-- see :help lsp-zero-keybindings local lsp_attach = function(client, bufnr)
-- to learn the available actions -- see :help lsp-zero-keybindings to learn the available actions
-- or https://lsp-zero.netlify.app/docs/language-server-configuration.html#default-keymaps
-- https://www.reddit.com/r/neovim/comments/1ankiu1/lsp_zero_go_to_definition_stopped_working/ -- https://www.reddit.com/r/neovim/comments/1ankiu1/lsp_zero_go_to_definition_stopped_working/
lsp_zero.default_keymaps({ buffer = bufnr, preserve_mappings = false }) lsp_zero.default_keymaps({ buffer = bufnr, preserve_mappings = false })
end) end
lsp_zero.extend_lspconfig({
sign_text = true,
lsp_attach = lsp_attach,
capabilities = require("cmp_nvim_lsp").default_capabilities(),
})
require("mason").setup({ require("mason").setup({
ui = { ui = {
@ -124,6 +130,38 @@ return {
lua_ls = function() lua_ls = function()
local lua_opts = lsp_zero.nvim_lua_ls() local lua_opts = lsp_zero.nvim_lua_ls()
require("lspconfig").lua_ls.setup(lua_opts) require("lspconfig").lua_ls.setup(lua_opts)
require("lspconfig").gopls.setup({})
require("lspconfig").yamlls.setup({
settings = {
yaml = {
-- https://www.arthurkoziel.com/json-schemas-in-neovim/
schemaStore = {
enable = false,
url = "",
},
schemas = {
["https://raw.githubusercontent.com/awslabs/goformation/master/schema/cloudformation.schema.json"] = "cf-*{yml,yaml}",
-- ["https://json.schemastore.org/kustomization.json"] = "kustomization.{yml,yaml}",
-- ["https://raw.githubusercontent.com/docker/compose/master/compose/config/compose_spec.json"] = "docker-compose*.{yml,yaml}",
-- ["https://raw.githubusercontent.com/datreeio/CRDs-catalog/main/argoproj.io/application_v1alpha1.json"] = "argocd-application.yaml",
},
},
},
})
require("lspconfig").taplo.setup({
-- Taplo loads all schemas (not selectively)
settings = {
evenBetterToml = {
-- https://www.arthurkoziel.com/json-schemas-in-neovim/
schema = {
-- additional schemas
-- associations = {
-- ["alacritty\\.toml$"] = "https://raw.githubusercontent.com/distinction-dev/alacritty-schema/main/alacritty/reference.json",
-- },
},
},
},
})
end, end,
}, },
}) })

View file

@ -20,6 +20,9 @@ return {
-- make sure they don't collide with the navigation keymaps -- make sure they don't collide with the navigation keymaps
dictionary = "saflewcmpghio", dictionary = "saflewcmpghio",
}, },
ui = {
position = "topright",
},
navigate = { navigate = {
cancel_snipe = "q", cancel_snipe = "q",
-- Close the buffer under the cursor -- Close the buffer under the cursor