init
This commit is contained in:
39
nvim/lua/plugins/extras/lsp/actions-preview.lua
Normal file
39
nvim/lua/plugins/extras/lsp/actions-preview.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = function()
|
||||
local keys = require("lazyvim.plugins.lsp.keymaps").get()
|
||||
|
||||
keys[#keys + 1] = {
|
||||
"<leader>ca",
|
||||
function()
|
||||
require("actions-preview").code_actions()
|
||||
end,
|
||||
mode = { "n", "v" },
|
||||
desc = "Code Action Preview",
|
||||
}
|
||||
keys[#keys + 1] = { "gr", "<cmd>Glance references<cr>", desc = "Goto References" }
|
||||
keys[#keys + 1] = { "gy", "<cmd>Glance type_definitions<cr>", desc = "Goto T[y]pe Definitions" }
|
||||
keys[#keys + 1] = { "gI", "<cmd>Glance implementations<cr>", desc = "Goto Implementations" }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"aznhe21/actions-preview.nvim",
|
||||
event = "LspAttach",
|
||||
opts = {
|
||||
telescope = {
|
||||
sorting_strategy = "ascending",
|
||||
layout_strategy = "vertical",
|
||||
layout_config = {
|
||||
width = 0.6,
|
||||
height = 0.7,
|
||||
prompt_position = "top",
|
||||
preview_cutoff = 20,
|
||||
preview_height = function(_, _, max_lines)
|
||||
return max_lines - 15
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
8
nvim/lua/plugins/extras/lsp/file-operations.lua
Normal file
8
nvim/lua/plugins/extras/lsp/file-operations.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
optional = true,
|
||||
dependencies = {
|
||||
"antosha417/nvim-lsp-file-operations",
|
||||
opts = {},
|
||||
},
|
||||
}
|
||||
8
nvim/lua/plugins/extras/lsp/garbage-day.lua
Normal file
8
nvim/lua/plugins/extras/lsp/garbage-day.lua
Normal file
@@ -0,0 +1,8 @@
|
||||
return {
|
||||
"zeioth/garbage-day.nvim",
|
||||
event = "LspAttach",
|
||||
opts = {
|
||||
notifications = true,
|
||||
grace_period = 60 * 10,
|
||||
},
|
||||
}
|
||||
40
nvim/lua/plugins/extras/lsp/glance.lua
Normal file
40
nvim/lua/plugins/extras/lsp/glance.lua
Normal file
@@ -0,0 +1,40 @@
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
opts = function()
|
||||
local keys = require("lazyvim.plugins.lsp.keymaps").get()
|
||||
|
||||
keys[#keys + 1] = { "gd", "<cmd>Glance definitions<cr>", desc = "Goto Definitions" }
|
||||
keys[#keys + 1] = { "gr", "<cmd>Glance references<cr>", desc = "Goto References" }
|
||||
keys[#keys + 1] = { "gy", "<cmd>Glance type_definitions<cr>", desc = "Goto T[y]pe Definitions" }
|
||||
keys[#keys + 1] = { "gI", "<cmd>Glance implementations<cr>", desc = "Goto Implementations" }
|
||||
end,
|
||||
},
|
||||
{
|
||||
"dnlhc/glance.nvim",
|
||||
cmd = { "Glance" },
|
||||
event = "LspAttach",
|
||||
opts = {
|
||||
border = {
|
||||
enable = true,
|
||||
},
|
||||
use_trouble_qf = true,
|
||||
hooks = {
|
||||
before_open = function(results, open, jump, method)
|
||||
local uri = vim.uri_from_bufnr(0)
|
||||
if #results == 1 then
|
||||
local target_uri = results[1].uri or results[1].targetUri
|
||||
|
||||
if target_uri == uri then
|
||||
jump(results[1])
|
||||
else
|
||||
open(results)
|
||||
end
|
||||
else
|
||||
open(results)
|
||||
end
|
||||
end,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
5
nvim/lua/plugins/extras/lsp/inc-rename.lua
Normal file
5
nvim/lua/plugins/extras/lsp/inc-rename.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"smjonas/inc-rename.nvim",
|
||||
cmd = "IncRename",
|
||||
opts = {},
|
||||
}
|
||||
19
nvim/lua/plugins/extras/lsp/lens.lua
Normal file
19
nvim/lua/plugins/extras/lsp/lens.lua
Normal file
@@ -0,0 +1,19 @@
|
||||
return {
|
||||
"VidocqH/lsp-lens.nvim",
|
||||
event = "LspAttach",
|
||||
opts = {
|
||||
sections = {
|
||||
definition = false,
|
||||
references = function(count)
|
||||
return " Ref: " .. count
|
||||
end,
|
||||
implements = function(count)
|
||||
return " Imp: " .. count
|
||||
end,
|
||||
git_authors = false,
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{ "<leader>ue", "<cmd>LspLensToggle<cr>", desc = "Toggle Lsp Lens" },
|
||||
},
|
||||
}
|
||||
12
nvim/lua/plugins/extras/lsp/lightbulb.lua
Normal file
12
nvim/lua/plugins/extras/lsp/lightbulb.lua
Normal file
@@ -0,0 +1,12 @@
|
||||
return {
|
||||
"kosayoda/nvim-lightbulb",
|
||||
event = "LspAttach",
|
||||
opts = {
|
||||
autocmd = { enabled = true },
|
||||
sign = { enabled = true, text = "" },
|
||||
action_kinds = { "quickfix", "refactor" },
|
||||
ignore = {
|
||||
actions_without_kind = true,
|
||||
},
|
||||
},
|
||||
}
|
||||
66
nvim/lua/plugins/extras/lsp/lspconfig-extended.lua
Normal file
66
nvim/lua/plugins/extras/lsp/lspconfig-extended.lua
Normal file
@@ -0,0 +1,66 @@
|
||||
local nvim_0_10 = vim.fn.has("nvim-0.10")
|
||||
local prefix = "<leader>cl"
|
||||
|
||||
return {
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
init = function()
|
||||
local keys = require("lazyvim.plugins.lsp.keymaps").get()
|
||||
|
||||
keys[#keys + 1] = { "<leader>cl", false }
|
||||
keys[#keys + 1] = { "<leader>cil", "<cmd>LspInfo<cr>", desc = "Lsp" }
|
||||
keys[#keys + 1] = { prefix .. "r", "<cmd>LspRestart<cr>", desc = "Restart Lsp" }
|
||||
keys[#keys + 1] = { prefix .. "s", "<cmd>LspStart<cr>", desc = "Start Lsp" }
|
||||
keys[#keys + 1] = { prefix .. "S", "<cmd>LspStop<cr>", desc = "Stop Lsp" }
|
||||
|
||||
-- stylua: ignore start
|
||||
keys[#keys + 1] = { prefix .. "r", function() vim.lsp.buf.remove_workspace_folder() end, desc = "Remove workspace" }
|
||||
keys[#keys + 1] = { prefix .. "a", function() vim.lsp.buf.add_workspace_folder() end, desc = "Add workspace" }
|
||||
-- stylua: ignore end
|
||||
end,
|
||||
opts = {
|
||||
diagnostics = {
|
||||
virtual_text = {
|
||||
float = {
|
||||
border = {
|
||||
{ "┌", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "┐", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
{ "┘", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "└", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
inlay_hints = {
|
||||
enabled = nvim_0_10,
|
||||
},
|
||||
codelens = {
|
||||
enabled = false,
|
||||
},
|
||||
servers = {
|
||||
lua_ls = {
|
||||
settings = {
|
||||
Lua = {
|
||||
hint = {
|
||||
enable = nvim_0_10,
|
||||
setType = nvim_0_10,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
opts = {
|
||||
spec = {
|
||||
{ "<leader>cl", group = "lsp", icon = " " },
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
7
nvim/lua/plugins/extras/lsp/mason-extended.lua
Normal file
7
nvim/lua/plugins/extras/lsp/mason-extended.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"williamboman/mason.nvim",
|
||||
keys = {
|
||||
{ "<leader>cm", false },
|
||||
{ "<leader>cim", "<cmd>Mason<cr>", desc = "Mason" },
|
||||
},
|
||||
}
|
||||
7
nvim/lua/plugins/extras/lsp/neodim.lua
Normal file
7
nvim/lua/plugins/extras/lsp/neodim.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
"zbirenbaum/neodim",
|
||||
event = "LspAttach",
|
||||
opts = {
|
||||
alpha = 0.60,
|
||||
},
|
||||
}
|
||||
22
nvim/lua/plugins/extras/lsp/symbol-usage.lua
Normal file
22
nvim/lua/plugins/extras/lsp/symbol-usage.lua
Normal file
@@ -0,0 +1,22 @@
|
||||
return {
|
||||
"Wansmer/symbol-usage.nvim",
|
||||
event = function()
|
||||
if vim.fn.has("nvim-0.10") == 1 then
|
||||
return "LspAttach"
|
||||
else
|
||||
return "BufRead"
|
||||
end
|
||||
end,
|
||||
opts = {
|
||||
vt_position = "end_of_line",
|
||||
text_format = function(symbol)
|
||||
if symbol.references then
|
||||
local usage = symbol.references <= 1 and "usage" or "usages"
|
||||
local num = symbol.references == 0 and "no" or symbol.references
|
||||
return string.format(" %s %s", num, usage)
|
||||
else
|
||||
return ""
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
5
nvim/lua/plugins/extras/lsp/workspace-diagnostics.lua
Normal file
5
nvim/lua/plugins/extras/lsp/workspace-diagnostics.lua
Normal file
@@ -0,0 +1,5 @@
|
||||
return {
|
||||
"artemave/workspace-diagnostics.nvim",
|
||||
event = "LspAttach",
|
||||
opts = {},
|
||||
}
|
||||
Reference in New Issue
Block a user