removed unused plugins
This commit is contained in:
parent
97a0d6f173
commit
b213dd4731
|
@ -1,5 +0,0 @@
|
||||||
return {
|
|
||||||
{
|
|
||||||
"echasnovski/mini.bufremove",
|
|
||||||
},
|
|
||||||
}
|
|
|
@ -1,65 +0,0 @@
|
||||||
return {
|
|
||||||
{
|
|
||||||
"nvim-neo-tree/neo-tree.nvim",
|
|
||||||
branch = "v3.x",
|
|
||||||
dependencies = {
|
|
||||||
"nvim-lua/plenary.nvim",
|
|
||||||
"nvim-tree/nvim-web-devicons",
|
|
||||||
"MunifTanjim/nui.nvim",
|
|
||||||
-- "3rd/image.nvim", -- Optional image support in preview window: See `# Preview Mode` for more information
|
|
||||||
},
|
|
||||||
opts = {
|
|
||||||
popup_border_style = "rounded",
|
|
||||||
close_if_last_window = true,
|
|
||||||
enable_git_status = true,
|
|
||||||
enable_diagnostics = true,
|
|
||||||
open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes
|
|
||||||
default_component_configs = {
|
|
||||||
indent = {
|
|
||||||
indent_size = 2,
|
|
||||||
padding = 1, -- extra padding on left hand side
|
|
||||||
-- indent guides
|
|
||||||
with_markers = true,
|
|
||||||
indent_marker = "│",
|
|
||||||
last_indent_marker = "└",
|
|
||||||
highlight = "NeoTreeIndentMarker",
|
|
||||||
-- expander config, needed for nesting files
|
|
||||||
with_expanders = true, -- if nil and file nesting is enabled, will enable expanders
|
|
||||||
expander_collapsed = "",
|
|
||||||
expander_expanded = "",
|
|
||||||
expander_highlight = "NeoTreeExpander",
|
|
||||||
},
|
|
||||||
git_status = {
|
|
||||||
symbols = {
|
|
||||||
-- Change type
|
|
||||||
added = "+", -- or "✚", but this is redundant info if you use git_status_colors on the name
|
|
||||||
modified = "M", -- or "", but this is redundant info if you use git_status_colors on the name
|
|
||||||
deleted = "D", -- this can only be used in the git_status source
|
|
||||||
renamed = "", -- this can only be used in the git_status source
|
|
||||||
-- Status type
|
|
||||||
untracked = "",
|
|
||||||
ignored = "",
|
|
||||||
unstaged = "U",
|
|
||||||
staged = "S",
|
|
||||||
conflict = " ",
|
|
||||||
}
|
|
||||||
},
|
|
||||||
modified = {
|
|
||||||
symbol = "+",
|
|
||||||
highlight = "NeoTreeModified",
|
|
||||||
},
|
|
||||||
buffers = {
|
|
||||||
follow_current_file = {
|
|
||||||
enabled = true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
filesystem = {
|
|
||||||
use_libuv_file_watcher = true,
|
|
||||||
follow_current_file = {
|
|
||||||
enabled = true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,75 +0,0 @@
|
||||||
return {
|
|
||||||
{
|
|
||||||
"hrsh7th/nvim-cmp",
|
|
||||||
opts = function()
|
|
||||||
vim.api.nvim_set_hl(0, "CmpGhostText", { link = "Comment", default = true })
|
|
||||||
local cmp = require("cmp")
|
|
||||||
local defaults = require("cmp.config.default")()
|
|
||||||
return {
|
|
||||||
window = {
|
|
||||||
completion = {
|
|
||||||
border = "rounded",
|
|
||||||
scrollbar = false,
|
|
||||||
winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenu,Search:None"
|
|
||||||
},
|
|
||||||
documentation = {
|
|
||||||
border = "rounded",
|
|
||||||
scrollbar = false,
|
|
||||||
winhighlight = "Normal:CmpPmenu,FloatBorder:CmpPmenu,Search:None"
|
|
||||||
},
|
|
||||||
},
|
|
||||||
snippet = {
|
|
||||||
expand = function(args)
|
|
||||||
require("luasnip").lsp_expand(args.body)
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
mapping = cmp.mapping.preset.insert({
|
|
||||||
["<C-n>"] = cmp.mapping.select_next_item({ behavior = cmp.SelectBehavior.Insert }),
|
|
||||||
["<C-p>"] = cmp.mapping.select_prev_item({ behavior = cmp.SelectBehavior.Insert }),
|
|
||||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
|
||||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
|
||||||
["<C-Space>"] = cmp.mapping.complete(),
|
|
||||||
["<C-e>"] = cmp.mapping.abort(),
|
|
||||||
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
["<S-CR>"] = cmp.mapping.confirm({
|
|
||||||
behavior = cmp.ConfirmBehavior.Replace,
|
|
||||||
select = true,
|
|
||||||
}), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
|
||||||
["<C-CR>"] = function(fallback)
|
|
||||||
cmp.abort()
|
|
||||||
fallback()
|
|
||||||
end,
|
|
||||||
}),
|
|
||||||
sources = cmp.config.sources({
|
|
||||||
{ name = "nvim_lsp" },
|
|
||||||
{ name = "luasnip" },
|
|
||||||
{ name = "path" },
|
|
||||||
}, {
|
|
||||||
{ name = "buffer" },
|
|
||||||
}),
|
|
||||||
formatting = {
|
|
||||||
format = function(_, item)
|
|
||||||
local icons = require("lazyvim.config").icons.kinds
|
|
||||||
if icons[item.kind] then
|
|
||||||
item.kind = icons[item.kind] .. item.kind
|
|
||||||
end
|
|
||||||
return item
|
|
||||||
end,
|
|
||||||
},
|
|
||||||
experimental = {
|
|
||||||
ghost_text = {
|
|
||||||
hl_group = "CmpGhostText",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
sorting = defaults.sorting,
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
dependencies = {
|
|
||||||
"hrsh7th/cmp-nvim-lsp",
|
|
||||||
"hrsh7th/cmp-buffer",
|
|
||||||
"hrsh7th/cmp-path",
|
|
||||||
'hrsh7th/cmp-cmdline',
|
|
||||||
"saadparwaiz1/cmp_luasnip",
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,170 +0,0 @@
|
||||||
return {
|
|
||||||
{
|
|
||||||
"neovim/nvim-lspconfig",
|
|
||||||
dependencies = {
|
|
||||||
"williamboman/mason.nvim",
|
|
||||||
"williamboman/mason-lspconfig.nvim"
|
|
||||||
},
|
|
||||||
---@class PluginLspOpts
|
|
||||||
opts = {
|
|
||||||
-- options for vim.diagnostic.config()
|
|
||||||
diagnostics = {
|
|
||||||
underline = true,
|
|
||||||
update_in_insert = false,
|
|
||||||
virtual_text = {
|
|
||||||
spacing = 4,
|
|
||||||
source = "if_many",
|
|
||||||
prefix = "●",
|
|
||||||
-- this will set set the prefix to a function that returns the diagnostics icon based on the severity
|
|
||||||
-- this only works on a recent 0.10.0 build. Will be set to "●" when not supported
|
|
||||||
-- prefix = "icons",
|
|
||||||
},
|
|
||||||
severity_sort = true,
|
|
||||||
float = {
|
|
||||||
border = "rounded"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
-- Enable this to enable the builtin LSP inlay hints on Neovim >= 0.10.0
|
|
||||||
-- Be aware that you also will need to properly configure your LSP server to
|
|
||||||
-- provide the inlay hints.
|
|
||||||
inlay_hints = {
|
|
||||||
enabled = false,
|
|
||||||
},
|
|
||||||
-- add any global capabilities here
|
|
||||||
capabilities = {},
|
|
||||||
-- options for vim.lsp.buf.format
|
|
||||||
-- `bufnr` and `filter` is handled by the LazyVim formatter,
|
|
||||||
-- but can be also overridden when specified
|
|
||||||
format = {
|
|
||||||
formatting_options = nil,
|
|
||||||
timeout_ms = nil,
|
|
||||||
},
|
|
||||||
servers = require("core.language-server"),
|
|
||||||
setup = {
|
|
||||||
}
|
|
||||||
},
|
|
||||||
---@param opts PluginLspOpts
|
|
||||||
config = function(_, opts)
|
|
||||||
local Util = require("lazyvim.util")
|
|
||||||
if Util.has("neoconf.nvim") then
|
|
||||||
local plugin = require("lazy.core.config").spec.plugins["neoconf.nvim"]
|
|
||||||
require("neoconf").setup(require("lazy.core.plugin").values(plugin, "opts", false))
|
|
||||||
end
|
|
||||||
|
|
||||||
-- setup autoformat
|
|
||||||
Util.format.register(Util.lsp.formatter())
|
|
||||||
|
|
||||||
-- deprectaed options
|
|
||||||
if opts.autoformat ~= nil then
|
|
||||||
vim.g.autoformat = opts.autoformat
|
|
||||||
Util.deprecate("nvim-lspconfig.opts.autoformat", "vim.g.autoformat")
|
|
||||||
end
|
|
||||||
|
|
||||||
-- setup keymaps
|
|
||||||
Util.lsp.on_attach(function(client, buffer)
|
|
||||||
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
|
|
||||||
end)
|
|
||||||
|
|
||||||
local register_capability = vim.lsp.handlers["client/registerCapability"]
|
|
||||||
|
|
||||||
vim.lsp.handlers["client/registerCapability"] = function(err, res, ctx)
|
|
||||||
local ret = register_capability(err, res, ctx)
|
|
||||||
local client_id = ctx.client_id
|
|
||||||
---@type lsp.Client
|
|
||||||
local client = vim.lsp.get_client_by_id(client_id)
|
|
||||||
local buffer = vim.api.nvim_get_current_buf()
|
|
||||||
require("lazyvim.plugins.lsp.keymaps").on_attach(client, buffer)
|
|
||||||
return ret
|
|
||||||
end
|
|
||||||
|
|
||||||
-- diagnostics
|
|
||||||
for name, icon in pairs(require("lazyvim.config").icons.diagnostics) do
|
|
||||||
name = "DiagnosticSign" .. name
|
|
||||||
vim.fn.sign_define(name, { text = icon, texthl = name, numhl = "" })
|
|
||||||
end
|
|
||||||
|
|
||||||
local inlay_hint = vim.lsp.buf.inlay_hint or vim.lsp.inlay_hint
|
|
||||||
|
|
||||||
if opts.inlay_hints.enabled and inlay_hint then
|
|
||||||
Util.lsp.on_attach(function(client, buffer)
|
|
||||||
if client.supports_method("textDocument/inlayHint") then
|
|
||||||
inlay_hint(buffer, true)
|
|
||||||
end
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
|
|
||||||
if type(opts.diagnostics.virtual_text) == "table" and opts.diagnostics.virtual_text.prefix == "icons" then
|
|
||||||
opts.diagnostics.virtual_text.prefix = vim.fn.has("nvim-0.10.0") == 0 and "●"
|
|
||||||
or function(diagnostic)
|
|
||||||
local icons = require("lazyvim.config").icons.diagnostics
|
|
||||||
for d, icon in pairs(icons) do
|
|
||||||
if diagnostic.severity == vim.diagnostic.severity[d:upper()] then
|
|
||||||
return icon
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
vim.diagnostic.config(vim.deepcopy(opts.diagnostics))
|
|
||||||
|
|
||||||
local servers = opts.servers
|
|
||||||
local has_cmp, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
|
|
||||||
local capabilities = vim.tbl_deep_extend(
|
|
||||||
"force",
|
|
||||||
{},
|
|
||||||
vim.lsp.protocol.make_client_capabilities(),
|
|
||||||
has_cmp and cmp_nvim_lsp.default_capabilities() or {},
|
|
||||||
opts.capabilities or {}
|
|
||||||
)
|
|
||||||
|
|
||||||
local function setup(server)
|
|
||||||
local server_opts = vim.tbl_deep_extend("force", {
|
|
||||||
capabilities = vim.deepcopy(capabilities),
|
|
||||||
}, servers[server] or {})
|
|
||||||
|
|
||||||
if opts.setup[server] then
|
|
||||||
if opts.setup[server](server, server_opts) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
elseif opts.setup["*"] then
|
|
||||||
if opts.setup["*"](server, server_opts) then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
end
|
|
||||||
require("lspconfig")[server].setup(server_opts)
|
|
||||||
end
|
|
||||||
|
|
||||||
-- get all the servers that are available through mason-lspconfig
|
|
||||||
local have_mason, mlsp = pcall(require, "mason-lspconfig")
|
|
||||||
local all_mslp_servers = {}
|
|
||||||
if have_mason then
|
|
||||||
all_mslp_servers = vim.tbl_keys(require("mason-lspconfig.mappings.server").lspconfig_to_package)
|
|
||||||
end
|
|
||||||
|
|
||||||
local ensure_installed = {} ---@type string[]
|
|
||||||
for server, server_opts in pairs(servers) do
|
|
||||||
if server_opts then
|
|
||||||
server_opts = server_opts == true and {} or server_opts
|
|
||||||
-- run manual setup if mason=false or if this is a server that cannot be installed with mason-lspconfig
|
|
||||||
if server_opts.mason == false or not vim.tbl_contains(all_mslp_servers, server) then
|
|
||||||
setup(server)
|
|
||||||
else
|
|
||||||
ensure_installed[#ensure_installed + 1] = server
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
if have_mason then
|
|
||||||
mlsp.setup({ ensure_installed = ensure_installed, handlers = { setup } })
|
|
||||||
end
|
|
||||||
|
|
||||||
if Util.lsp.get_config("denols") and Util.lsp.get_config("tsserver") then
|
|
||||||
local is_deno = require("lspconfig.util").root_pattern("deno.json", "deno.jsonc")
|
|
||||||
Util.lsp.disable("tsserver", is_deno)
|
|
||||||
Util.lsp.disable("denols", function(root_dir)
|
|
||||||
return not is_deno(root_dir)
|
|
||||||
end)
|
|
||||||
end
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue