add a bunch of essential plugins
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
---@type LazySpec
|
||||
return {
|
||||
"AstroNvim/astrolsp",
|
||||
'AstroNvim/astrolsp',
|
||||
---@type AstroLSPOpts
|
||||
opts = {
|
||||
-- Configuration table of features provided by AstroLSP
|
||||
@@ -61,16 +61,18 @@ return {
|
||||
-- can either be a string of a client capability or a function of `fun(client, bufnr): boolean`
|
||||
-- condition will be resolved for each client on each execution and if it ever fails for all clients,
|
||||
-- the auto commands will be deleted for that buffer
|
||||
cond = "textDocument/codeLens",
|
||||
cond = 'textDocument/codeLens',
|
||||
-- cond = function(client, bufnr) return client.name == "lua_ls" end,
|
||||
-- list of auto commands to set
|
||||
{
|
||||
-- events to trigger
|
||||
event = { "InsertLeave", "BufEnter" },
|
||||
event = { 'InsertLeave', 'BufEnter' },
|
||||
-- the rest of the autocmd options (:h nvim_create_autocmd)
|
||||
desc = "Refresh codelens (buffer)",
|
||||
desc = 'Refresh codelens (buffer)',
|
||||
callback = function(args)
|
||||
if require("astrolsp").config.features.codelens then vim.lsp.codelens.refresh { bufnr = args.buf } end
|
||||
if require('astrolsp').config.features.codelens then
|
||||
vim.lsp.codelens.refresh { bufnr = args.buf }
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
@@ -80,19 +82,24 @@ return {
|
||||
n = {
|
||||
-- a `cond` key can provided as the string of a server capability to be required to attach, or a function with `client` and `bufnr` parameters from the `on_attach` that returns a boolean
|
||||
gD = {
|
||||
function() vim.lsp.buf.declaration() end,
|
||||
desc = "Declaration of current symbol",
|
||||
cond = "textDocument/declaration",
|
||||
function()
|
||||
vim.lsp.buf.declaration()
|
||||
end,
|
||||
desc = 'Declaration of current symbol',
|
||||
cond = 'textDocument/declaration',
|
||||
},
|
||||
["<Leader>uY"] = {
|
||||
function() require("astrolsp.toggles").buffer_semantic_tokens() end,
|
||||
desc = "Toggle LSP semantic highlight (buffer)",
|
||||
['<Leader>uY'] = {
|
||||
function()
|
||||
require('astrolsp.toggles').buffer_semantic_tokens()
|
||||
end,
|
||||
desc = 'Toggle LSP semantic highlight (buffer)',
|
||||
cond = function(client)
|
||||
return client.supports_method "textDocument/semanticTokens/full" and vim.lsp.semantic_tokens ~= nil
|
||||
return client.supports_method 'textDocument/semanticTokens/full' and vim.lsp.semantic_tokens ~= nil
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
-- A custom `on_attach` function to be run after the default `on_attach` function
|
||||
-- takes two parameters `client` and `bufnr` (`:h lspconfig-setup`)
|
||||
on_attach = function(client, bufnr)
|
||||
|
||||
Reference in New Issue
Block a user