Compare commits
3 commits
1b2bd5e244
...
65b0e78b35
| Author | SHA1 | Date | |
|---|---|---|---|
| 65b0e78b35 | |||
| efd0a1fa52 | |||
| b54dabe9cd |
3 changed files with 50 additions and 6 deletions
|
|
@ -3,4 +3,7 @@ return {
|
|||
branch = "main",
|
||||
--event = "VeryLazy",
|
||||
opts = {},
|
||||
dependencies = {
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
return {
|
||||
{
|
||||
"VonHeikemen/lsp-zero.nvim",
|
||||
branch = "v3.x",
|
||||
branch = "v4.x",
|
||||
lazy = true,
|
||||
config = false,
|
||||
init = function()
|
||||
|
|
@ -90,15 +90,21 @@ return {
|
|||
})
|
||||
-- This is where all the LSP shenanigans will live
|
||||
local lsp_zero = require("lsp-zero")
|
||||
lsp_zero.extend_lspconfig()
|
||||
|
||||
-- Keybindings only active when a LS is active for the curr. file
|
||||
lsp_zero.on_attach(function(client, bufnr)
|
||||
-- see :help lsp-zero-keybindings
|
||||
-- to learn the available actions
|
||||
-- lsp_zero.on_attach(function(client, bufnr)
|
||||
local lsp_attach = function(client, bufnr)
|
||||
-- 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/
|
||||
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({
|
||||
ui = {
|
||||
|
|
@ -124,6 +130,38 @@ return {
|
|||
lua_ls = function()
|
||||
local lua_opts = lsp_zero.nvim_lua_ls()
|
||||
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,
|
||||
},
|
||||
})
|
||||
|
|
|
|||
|
|
@ -20,6 +20,9 @@ return {
|
|||
-- make sure they don't collide with the navigation keymaps
|
||||
dictionary = "saflewcmpghio",
|
||||
},
|
||||
ui = {
|
||||
position = "topright",
|
||||
},
|
||||
navigate = {
|
||||
cancel_snipe = "q",
|
||||
-- Close the buffer under the cursor
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue