neovim plugin cleanup

This commit is contained in:
Alexander Navarro 2024-11-22 16:54:43 -03:00
parent 4a5a878a7f
commit 7c0c670e29
13 changed files with 311 additions and 360 deletions

View file

@ -16,27 +16,24 @@
"copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" }, "copilot-cmp": { "branch": "master", "commit": "b6e5286b3d74b04256d0a7e3bd2908eabec34b44" },
"copilot-lualine": { "branch": "main", "commit": "f40450c3e138766026327e7807877ea860618258" }, "copilot-lualine": { "branch": "main", "commit": "f40450c3e138766026327e7807877ea860618258" },
"copilot.lua": { "branch": "master", "commit": "f8d8d872bb319f640d5177dad5fbf01f7a16d7d0" }, "copilot.lua": { "branch": "master", "commit": "f8d8d872bb319f640d5177dad5fbf01f7a16d7d0" },
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
"dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" }, "dressing.nvim": { "branch": "master", "commit": "fc78a3ca96f4db9f8893bb7e2fd9823e0780451b" },
"friendly-snippets": { "branch": "main", "commit": "45a1b96e46efe5fce8af325d4bed45feb9d29d0f" }, "friendly-snippets": { "branch": "main", "commit": "45a1b96e46efe5fce8af325d4bed45feb9d29d0f" },
"gitsigns.nvim": { "branch": "main", "commit": "e9c4187c3774a46df2d086a66cf3a7e6bea4c432" }, "gitsigns.nvim": { "branch": "main", "commit": "e9c4187c3774a46df2d086a66cf3a7e6bea4c432" },
"grapple.nvim": { "branch": "main", "commit": "b41ddfc1c39f87f3d1799b99c2f0f1daa524c5f7" }, "grapple.nvim": { "branch": "main", "commit": "b41ddfc1c39f87f3d1799b99c2f0f1daa524c5f7" },
"indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" }, "indent-blankline.nvim": { "branch": "master", "commit": "7871a88056f7144defca9c931e311a3134c5d509" },
"lazy.nvim": { "branch": "main", "commit": "56ead98e05bb37a4ec28930a54d836d033cf00f2" }, "lazy.nvim": { "branch": "main", "commit": "56ead98e05bb37a4ec28930a54d836d033cf00f2" },
"lazygit.nvim": { "branch": "main", "commit": "dc56df433bfbf107fee0139e187eb9750878fa84" }, "lazydev.nvim": { "branch": "main", "commit": "d5800897d9180cea800023f2429bce0a94ed6064" },
"lualine.nvim": { "branch": "master", "commit": "6a40b530539d2209f7dc0492f3681c8c126647ad" }, "lualine.nvim": { "branch": "master", "commit": "6a40b530539d2209f7dc0492f3681c8c126647ad" },
"luvit-meta": { "branch": "main", "commit": "57d464c4acb5c2e66bd4145060f5dc9e96a7bbb7" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" }, "mason-lspconfig.nvim": { "branch": "main", "commit": "37a336b653f8594df75c827ed589f1c91d91ff6c" },
"mason.nvim": { "branch": "main", "commit": "f96a31855fa8aea55599cea412fe611b85a874ed" }, "mason.nvim": { "branch": "main", "commit": "f96a31855fa8aea55599cea412fe611b85a874ed" },
"mini.clue": { "branch": "main", "commit": "08f792869781b4bfdfcaa55eb905b9635c0a243f" }, "mini.clue": { "branch": "main", "commit": "08f792869781b4bfdfcaa55eb905b9635c0a243f" },
"mini.comment": { "branch": "main", "commit": "c8406379987c321ecdef9f53e1ca741a55002104" }, "mini.comment": { "branch": "main", "commit": "c8406379987c321ecdef9f53e1ca741a55002104" },
"mini.surround": { "branch": "main", "commit": "3cb5b509ad34f2402df4b977be607a614c8c7524" }, "mini.surround": { "branch": "main", "commit": "3cb5b509ad34f2402df4b977be607a614c8c7524" },
"neodev.nvim": { "branch": "main", "commit": "46aa467dca16cf3dfe27098042402066d2ae242d" },
"neogen": { "branch": "main", "commit": "0daffcec249bf42275e322361fe55b89a05ff278" }, "neogen": { "branch": "main", "commit": "0daffcec249bf42275e322361fe55b89a05ff278" },
"neogit": { "branch": "master", "commit": "a20031fb5d7d12148764764059243135085e5c9b" },
"noice.nvim": { "branch": "main", "commit": "6263b6696811f0b11c88d8d2371134b1cc1762fc" }, "noice.nvim": { "branch": "main", "commit": "6263b6696811f0b11c88d8d2371134b1cc1762fc" },
"nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" }, "nui.nvim": { "branch": "main", "commit": "61574ce6e60c815b0a0c4b5655b8486ba58089a1" },
"nvim-autopairs": { "branch": "master", "commit": "78a4507bb9ffc9b00f11ae0ac48243d00cb9194d" }, "nvim-autopairs": { "branch": "master", "commit": "78a4507bb9ffc9b00f11ae0ac48243d00cb9194d" },
"nvim-bqf": { "branch": "main", "commit": "1b24dc6050c34e8cd377b6b4cd6abe40509e0187" },
"nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" }, "nvim-cmp": { "branch": "main", "commit": "a110e12d0b58eefcf5b771f533fc2cf3050680ac" },
"nvim-lint": { "branch": "master", "commit": "efc6fc83f0772283e064c53a8f9fb5645bde0bc0" }, "nvim-lint": { "branch": "master", "commit": "efc6fc83f0772283e064c53a8f9fb5645bde0bc0" },
"nvim-lspconfig": { "branch": "master", "commit": "216deb2d1b5fbf24398919228208649bbf5cbadf" }, "nvim-lspconfig": { "branch": "master", "commit": "216deb2d1b5fbf24398919228208649bbf5cbadf" },
@ -53,7 +50,7 @@
"render-markdown": { "branch": "main", "commit": "123048b428eb85618780fcef9ea9f4d68b5d2508" }, "render-markdown": { "branch": "main", "commit": "123048b428eb85618780fcef9ea9f4d68b5d2508" },
"smart-splits.nvim": { "branch": "master", "commit": "95833675cd92538bf9cded1d2d58d1fc271c5428" }, "smart-splits.nvim": { "branch": "master", "commit": "95833675cd92538bf9cded1d2d58d1fc271c5428" },
"telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" }, "telescope-fzf-native.nvim": { "branch": "main", "commit": "cf48d4dfce44e0b9a2e19a008d6ec6ea6f01a83b" },
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" }, "telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
"todo-comments.nvim": { "branch": "main", "commit": "d61567557e2ff5c548c74e96b2d9f8d33e5fcb34" }, "todo-comments.nvim": { "branch": "main", "commit": "d61567557e2ff5c548c74e96b2d9f8d33e5fcb34" },
"treesj": { "branch": "main", "commit": "6e8bd008bacd5ad001c3953017c1dca20709e915" }, "treesj": { "branch": "main", "commit": "6e8bd008bacd5ad001c3953017c1dca20709e915" },
"trouble.nvim": { "branch": "main", "commit": "03c1fbf518bef683422a3be9643c3da190903488" }, "trouble.nvim": { "branch": "main", "commit": "03c1fbf518bef683422a3be9643c3da190903488" },
@ -65,6 +62,5 @@
"vim-dadbod-ui": { "branch": "master", "commit": "f74a31e8c6c5a9dccc63450a09d5cd64a9294330" }, "vim-dadbod-ui": { "branch": "master", "commit": "f74a31e8c6c5a9dccc63450a09d5cd64a9294330" },
"vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" }, "vim-illuminate": { "branch": "master", "commit": "5eeb7951fc630682c322e88a9bbdae5c224ff0aa" },
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" }, "vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
"yazi.nvim": { "branch": "main", "commit": "faa03e9acb894533b91c811d0dafd816b995088f" }, "yazi.nvim": { "branch": "main", "commit": "faa03e9acb894533b91c811d0dafd816b995088f" }
"zk-nvim": { "branch": "main", "commit": "dbf4eeab55b08856c9d6b6722dbff39630bb35eb" }
} }

View file

@ -66,6 +66,18 @@ return {
end end
end end
local trouble = require("trouble")
local symbols = trouble.statusline({
mode = "lsp_document_symbols",
groups = {},
title = false,
filter = { range = true },
format = "{kind_icon}{symbol.name:Normal}",
-- The following line is needed to fix the background color
-- Set it to the lualine section you want to use
hl_group = "lualine_c_normal",
})
return { return {
options = { options = {
theme = "catppuccin", theme = "catppuccin",
@ -115,18 +127,12 @@ return {
}, },
}, },
{ codecompanion_status }, { codecompanion_status },
{ "aerial" },
{ {
"overseer", symbols.get,
cond = symbols.has,
}, },
{ {
-- Macro recording status "overseer",
function()
return require("noice").api.status.mode.get()
end,
cond = function()
return package.loaded["noice"] and require("noice").api.status.mode.has()
end,
}, },
}, },
lualine_x = { lualine_x = {
@ -137,6 +143,15 @@ return {
}, },
}, },
lualine_y = { lualine_y = {
{
-- Macro recording status
function()
return require("noice").api.status.mode.get()
end,
cond = function()
return package.loaded["noice"] and require("noice").api.status.mode.has()
end,
},
{ "searchcount" }, { "searchcount" },
{ "location" }, { "location" },
{ {

View file

@ -35,12 +35,8 @@ return {
["<ESC>"] = actions.close, ["<ESC>"] = actions.close,
["<C-q>"] = actions.send_to_qflist + actions.open_qflist, ["<C-q>"] = actions.send_to_qflist + actions.open_qflist,
["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist, ["<M-q>"] = actions.send_selected_to_qflist + actions.open_qflist,
["<c-t>"] = function(...) ["<c-t>"] = require("trouble.sources.telescope").open,
return require("trouble.providers.telescope").open_with_trouble(...) ["<a-t>"] = require("trouble.sources.telescope").open,
end,
["<a-t>"] = function(...)
return require("trouble.providers.telescope").open_selected_with_trouble(...)
end,
}, },
}, },
}, },

View file

@ -2,7 +2,6 @@ return {
{ {
-- Color Picker -- Color Picker
"uga-rosa/ccc.nvim", "uga-rosa/ccc.nvim",
event = "VeryLazy",
opts = { opts = {
auto_enable = true, auto_enable = true,
lsp = true, lsp = true,

View file

@ -1,6 +1,7 @@
return { return {
"stevearc/conform.nvim", "stevearc/conform.nvim",
event = "VeryLazy", event = { "BufWritePre" },
cmd = { "ConformInfo" },
opts = { opts = {
-- log_level = vim.log.levels.DEBUG, -- log_level = vim.log.levels.DEBUG,
@ -13,13 +14,13 @@ return {
-- have other formatters configured. -- have other formatters configured.
["_"] = { "trim_whitespace" }, ["_"] = { "trim_whitespace" },
blade = { "blade-formatter" }, blade = { "blade-formatter" },
css = { "prettierd", "prettier" }, css = { "biome" },
go = { "gofumpt", "goimports_reviser", "golines" }, go = { "gofumpt", "goimports_reviser", "golines" },
html = { "djlint", "prettierd", stop_after_first = true }, html = { "djlint", "prettierd", stop_after_first = true },
javascript = { "prettierd", "prettier", stop_after_first = true }, javascript = { "biome" },
javascriptreact = { "prettierd", "prettier", stop_after_first = true }, javascriptreact = { "biome" },
json = { "prettierd", "prettier", stop_after_first = true }, json = { "biome" },
jsonc = { "prettierd", "prettier", stop_after_first = true }, jsonc = { "biome" },
lua = { "stylua" }, lua = { "stylua" },
markdown = { "markdownlint" }, markdown = { "markdownlint" },
nim = { "nimpretty" }, nim = { "nimpretty" },
@ -27,8 +28,8 @@ return {
python = { "ruff_format", "ruff_organize_imports" }, python = { "ruff_format", "ruff_organize_imports" },
scss = { "prettierd", "prettier", stop_after_first = true }, scss = { "prettierd", "prettier", stop_after_first = true },
sh = { "shfmt" }, sh = { "shfmt" },
typescript = { "prettierd", "prettier", stop_after_first = true }, typescript = { "biome" },
typescriptreact = { "prettierd", "prettier", stop_after_first = true }, typescriptreact = { "biome" },
xml = { "lemminx" }, xml = { "lemminx" },
zsh = { "shfmt" } zsh = { "shfmt" }
}, },

View file

@ -32,66 +32,4 @@ return {
end, end,
}, },
}, },
{
"kdheepak/lazygit.nvim",
event = "VeryLazy",
dependencies = {
"nvim-lua/plenary.nvim",
},
keys = {
{ "<leader>gG", ":LazyGit<CR>", desc = "Lazygit" },
},
},
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim", -- required
"nvim-telescope/telescope.nvim", -- optional
"sindrets/diffview.nvim", -- optional
},
config = true,
opts = {
disable_line_numbers = false,
console_timeout = 8000,
graph_style = "unicode",
kind = "tab",
ignored_settings = {
"NeogitPushPopup--force",
"NeogitPullPopup--rebase",
"NeogitCommitPopup--allow-empty",
"NeogitCommitPopup--reuse-message",
"NeogitRevertPopup--no-edit",
},
},
keys = {
{
"<leader>gg",
function()
require("neogit").open()
end,
desc = "Neogit",
},
{
"<leader>gc",
function()
require("neogit").open({ "commit" })
end,
desc = "Commit",
},
{
"<leader>gp",
function()
require("neogit").open({ "pull" })
end,
desc = "Pull",
},
{
"<leader>gP",
function()
require("neogit").open({ "push" })
end,
desc = "Push",
},
},
},
} }

View file

@ -2,12 +2,10 @@ return {
{ {
"ckolkey/ts-node-action", "ckolkey/ts-node-action",
dependencies = { "nvim-treesitter" }, dependencies = { "nvim-treesitter" },
event = "VeryLazy", opts = {},
config = function() keys = {
require("ts-node-action").setup({}) { "<leader>ls", function() require("ts-node-action").node_action() end, desc = "Node Action" }
}
vim.keymap.set({ "n" }, "<leader>lA", require("ts-node-action").node_action, { desc = "Node Action" })
end,
}, },
{ {
"Wansmer/treesj", "Wansmer/treesj",

View file

@ -8,10 +8,10 @@ return {
lint.linters.gitlint.args = { "--contrib", "contrib-title-conventional-commits", "--msg-filename", "-" } lint.linters.gitlint.args = { "--contrib", "contrib-title-conventional-commits", "--msg-filename", "-" }
lint.linters_by_ft = { lint.linters_by_ft = {
javascript = { "eslint_d" }, javascript = { "biomejs" },
typescript = { "eslint_d" }, typescript = { "biomejs" },
javascriptreact = { "eslint_d" }, javascriptreact = { "biomejs" },
typescriptreact = { "eslint_d" }, typescriptreact = { "biomejs" },
-- astro = { "eslint_d" }, -- astro = { "eslint_d" },
python = { "ruff" }, python = { "ruff" },
sh = { "shellcheck" }, sh = { "shellcheck" },

View file

@ -1,253 +1,214 @@
return { { return {
-- LSP Configuration & Plugins -- LSP Plugins
"neovim/nvim-lspconfig", {
event = { "BufReadPost", "BufNewFile", "BufWritePre" }, -- `lazydev` configures Lua LSP for your Neovim config, runtime and plugins
dependencies = { -- used for completion, annotations and signatures of Neovim apis
-- Automatically install LSPs to stdpath for neovim 'folke/lazydev.nvim',
{ "williamboman/mason.nvim" }, ft = 'lua',
"williamboman/mason-lspconfig.nvim", opts = {
-- Additional lua configuration, makes nvim stuff amazing! library = {
{ "folke/neodev.nvim", opts = {} }, -- Load luvit types when the `vim.uv` word is found
{ path = 'luvit-meta/library', words = { 'vim%.uv' } },
},
},
}, },
{ "Bilal2453/luvit-meta", lazy = true }, -- optional `vim.uv` typings
{
-- LSP Configuration & Plugins
"neovim/nvim-lspconfig",
event = { "BufReadPost", "BufNewFile", "BufWritePre" },
dependencies = {
-- Automatically install LSPs to stdpath for neovim
{ "williamboman/mason.nvim", config = true },
"williamboman/mason-lspconfig.nvim",
},
config = function() config = function()
-- LSP settings. -- LSP settings.
local on_attach = function(_, bufnr) local on_attach = function(_, bufnr)
local nmap = function(keys, func, desc) local nmap = function(keys, func, desc)
if desc then if desc then
desc = "LSP: " .. desc desc = "LSP: " .. desc
end
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc })
end end
vim.keymap.set("n", keys, func, { buffer = bufnr, desc = desc }) nmap("<leader>lr", vim.lsp.buf.rename, "Rename")
-- stylua: ignore
vim.keymap.set({ "n", "x", "v" }, "<leader>la", vim.lsp.buf.code_action, { buffer = bufnr, desc = "Code Action" })
nmap("<leader>ld", vim.lsp.buf.type_definition, "Go to type definition")
nmap("<leader>lf", function()
vim.lsp.buf.format()
end, "Format")
nmap("gd", vim.lsp.buf.definition, "Go to definition")
nmap("gr", require("telescope.builtin").lsp_references, "Goto References")
nmap("gI", vim.lsp.buf.implementation, "Go to Implementation")
-- See `:help K` for why this keymap
nmap("K", vim.lsp.buf.hover, "Hover Documentation")
-- nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation")
-- Lesser used LSP functionality
nmap("gD", vim.lsp.buf.declaration, "Goto Declaration")
nmap("<leader>lj", vim.diagnostic.goto_next, "Go to next diagnostic")
nmap("<leader>lk", vim.diagnostic.goto_prev, "Go to prev diagnostic")
nmap("<leader>lK", function()
-- execute twice to enter the float inmediatly
vim.diagnostic.open_float()
vim.diagnostic.open_float()
end, "Hover current diagnostic")
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
vim.lsp.buf.format()
end, { desc = "Format current buffer with LSP" })
end end
nmap("<leader>lr", vim.lsp.buf.rename, "Rename") -- Enable the following language servers
-- stylua: ignore -- To see options and cofigurations: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
vim.keymap.set({ "n", "x", "v" }, "<leader>la", vim.lsp.buf.code_action, { buffer = bufnr, desc = "Code Action" }) local servers = {
nmap("<leader>ld", vim.lsp.buf.type_definition, "Go to type definition") astro = {},
nmap("<leader>lf", function() bashls = {},
vim.lsp.buf.format() cssls = {},
end, "Format") dockerls = {},
emmet_ls = {
nmap("gd", vim.lsp.buf.definition, "Go to definition") filetypes = {
nmap("gr", require("telescope.builtin").lsp_references, "Goto References") "astro",
nmap("gI", vim.lsp.buf.implementation, "Go to Implementation") "css",
"eruby",
-- See `:help K` for why this keymap "html",
nmap("K", vim.lsp.buf.hover, "Hover Documentation") "htmldjango",
-- nmap("<C-k>", vim.lsp.buf.signature_help, "Signature Documentation") "javascriptreact",
"less",
-- Lesser used LSP functionality "pug",
nmap("gD", vim.lsp.buf.declaration, "Goto Declaration") "sass",
"scss",
nmap("<leader>lj", vim.diagnostic.goto_next, "Go to next diagnostic") "svelte",
nmap("<leader>lk", vim.diagnostic.goto_prev, "Go to prev diagnostic") "typescriptreact",
nmap("<leader>lK", function() "vue",
-- execute twice to enter the float inmediatly "htmlangular",
vim.diagnostic.open_float() "php",
vim.diagnostic.open_float() "blade"
end, "Hover current diagnostic") },
-- Create a command `:Format` local to the LSP buffer
vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
vim.lsp.buf.format()
end, { desc = "Format current buffer with LSP" })
end
-- Enable the following language servers
-- To see options and cofigurations: https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
local servers = {
astro = {},
bashls = {},
cssls = {},
dockerls = {},
emmet_ls = {
filetypes = {
"astro",
"css",
"eruby",
"html",
"htmldjango",
"javascriptreact",
"less",
"pug",
"sass",
"scss",
"svelte",
"typescriptreact",
"vue",
"htmlangular",
"php",
"blade"
}, },
}, html = {},
html = {}, marksman = {},
["nil_ls"] = {}, pyright = {},
marksman = {}, phpactor = {},
pyright = {}, gopls = {
phpactor = {}, settings = {
gopls = { gopls = {
settings = { completeUnimported = true,
gopls = { usePlaceholders = true,
completeUnimported = true, analyses = {
usePlaceholders = true, unusedparams = true,
analyses = { },
unusedparams = true,
}, },
}, },
}, },
}, ruff = {},
ruff = {}, rust_analyzer = {
rust_analyzer = { settings = {
settings = { ["rust-analyzer"] = {
["rust-analyzer"] = { imports = {
imports = { granularity = {
granularity = { group = "module",
group = "module", },
prefix = "self",
}, },
prefix = "self", cargo = {
}, buildScripts = {
cargo = { enable = true,
buildScripts = { },
},
procMacro = {
enable = true, enable = true,
}, },
}, },
procMacro = {
enable = true,
},
}, },
}, },
}, sqlls = {},
sqlls = {}, yamlls = {},
yamlls = {}, lua_ls = {
tsserver = { settings = {
init_options = { Lua = {
preferences = { completion = {
disableSuggestions = true, callSnippet = 'Replace',
},
},
},
lua_ls = {
settings = {
Lua = {
runtime = {
-- Tell the language server which version of Lua you're using
-- (most likely LuaJIT in the case of Neovim)
version = "LuaJIT",
},
-- Make the server aware of Neovim runtime files
workspace = {
checkThirdParty = false,
library = {
vim.env.VIMRUNTIME,
-- "${3rd}/luv/library"
-- "${3rd}/busted/library",
}, },
diagnostics = { disable = { 'missing-fields' } },
}, },
}, },
}, },
}, }
}
-- nvim-cmp supports additional completion capabilities, so broadcast that to servers -- nvim-cmp supports additional completion capabilities, so broadcast that to servers
local capabilities = vim.lsp.protocol.make_client_capabilities() local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities) capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
-- Ensure the servers above are installed -- Ensure the servers above are installed
local mason_lspconfig = require("mason-lspconfig") local mason_lspconfig = require("mason-lspconfig")
mason_lspconfig.setup({ mason_lspconfig.setup({
ensure_installed = vim.tbl_keys(servers), ensure_installed = vim.tbl_keys(servers),
-- automatic_installation = { exclude = { "astro", "phpactor", "rust_analyzer", "sqlls" } }, automatic_installation = false,
automatic_installation = false, })
})
mason_lspconfig.setup_handlers({ mason_lspconfig.setup_handlers({
function(server_name) function(server_name)
local _border = "single" local _border = "single"
local default_config = { local default_config = {
capabilities = capabilities, capabilities = capabilities,
on_attach = on_attach, on_attach = on_attach,
handlers = { handlers = {
["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { ["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, {
border = _border, border = _border,
}), }),
["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { ["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, {
border = _border, border = _border,
max_width = 200, max_width = 200,
max_height = 200, max_height = 200,
focus = true, focus = true,
}), }),
}, },
} }
require("lspconfig")[server_name].setup( require("lspconfig")[server_name].setup(
vim.tbl_deep_extend("force", default_config, servers[server_name] or {}) vim.tbl_deep_extend("force", default_config, servers[server_name] or {})
) )
end,
})
vim.diagnostic.config({
update_in_insert = false,
underline = true,
float = {
source = true
},
virtual_text = {
severity = vim.diagnostic.severity.ERROR,
source = true,
spacing = -1,
prefix = nil,
format = function(diagnostic)
-- show small error code instead of whole error that probably won't fit in the screen
-- to see the whole error use other keybindings
return tostring(diagnostic.code)
end, end,
virt_text_hide = true })
},
severity_sort = true,
})
-- Customize gutter icons vim.diagnostic.config({
local signs = require("aleidk.constants").icons.diagnostics update_in_insert = false,
for type, icon in pairs(signs) do underline = true,
local hl = "DiagnosticSign" .. type float = {
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) source = true
end
end,
},
{
'stevearc/aerial.nvim',
-- Optional dependencies
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons"
},
opts = {
close_on_select = false,
show_guides = true,
autojump = true,
highlight_on_hover = true,
layout = {
default_direction = "float",
},
float = {
relative = "editor",
},
nav = {
preview = true,
keymaps = {
["q"] = "actions.close",
}, },
}, virtual_text = {
}, severity = vim.diagnostic.severity.ERROR,
source = true,
spacing = -1,
prefix = nil,
format = function(diagnostic)
-- show small error code instead of whole error that probably won't fit in the screen
-- to see the whole error use other keybindings
return tostring(diagnostic.code)
end,
virt_text_hide = true
},
severity_sort = true,
})
keys = { -- Customize gutter icons
{ "<leader>ll", function() require("aerial").toggle() end, desc = "Open syntax tree" }, local signs = require("aleidk.constants").icons.diagnostics
{ "<leader>lL", function() require("aerial").nav_toggle() end, desc = "Open syntax tree navigation" }, for type, icon in pairs(signs) do
{ "<leader>fl", "<CMD>Telescope aerial<CR>", desc = "Find in syntax tree" }, local hl = "DiagnosticSign" .. type
} vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
} end
end,
},
} }

View file

@ -1,8 +0,0 @@
return {
"williamboman/mason.nvim",
cmd = "Mason",
build = ":MasonUpdate",
opts = {
ensure_installed = {},
},
}

View file

@ -1,6 +1,7 @@
return { return {
"nosduco/remote-sshfs.nvim", "nosduco/remote-sshfs.nvim",
dependencies = { "nvim-telescope/telescope.nvim" }, dependencies = { "nvim-telescope/telescope.nvim" },
cmd = { "RemoteSSHFSConnec" },
config = function() config = function()
require("remote-sshfs").setup({}) require("remote-sshfs").setup({})
require("telescope").load_extension("remote-sshfs") require("telescope").load_extension("remote-sshfs")

View file

@ -19,13 +19,11 @@ local scroll_to_end = function(winid)
winid = winid or 0 winid = winid or 0
local bufnr = vim.api.nvim_win_get_buf(winid) local bufnr = vim.api.nvim_win_get_buf(winid)
local lnum = vim.api.nvim_buf_line_count(bufnr) local lnum = vim.api.nvim_buf_line_count(bufnr)
local last_line = vim.api.nvim_buf_get_lines(bufnr, -2, -1, true)[1]
-- Hack: terminal buffers add a bunch of empty lines at the end. We need to ignore them so that -- Hack: terminal buffers add a bunch of empty lines at the end. We need to ignore them so that
-- we don't end up scrolling off the end of the useful output. -- we don't end up scrolling off the end of the useful output.
local not_much_output = lnum < vim.o.lines + 6 local not_much_output = lnum < vim.o.lines + 6
if vim.bo[bufnr].buftype == "terminal" and not_much_output then if vim.bo[bufnr].buftype == "terminal" and not_much_output then
lnum = term_get_effective_line_count(bufnr) lnum = term_get_effective_line_count(bufnr)
last_line = vim.api.nvim_buf_get_lines(bufnr, lnum - 1, lnum, true)[1]
end end
local scrolloff = vim.api.nvim_get_option_value("scrolloff", { scope = "local", win = winid }) local scrolloff = vim.api.nvim_get_option_value("scrolloff", { scope = "local", win = winid })
vim.api.nvim_set_option_value("scrolloff", 0, { scope = "local", win = winid }) vim.api.nvim_set_option_value("scrolloff", 0, { scope = "local", win = winid })
@ -57,22 +55,22 @@ end
return { return {
"stevearc/overseer.nvim", "stevearc/overseer.nvim",
keys = { keys = {
{ "<leader>pO", "<CMD>OverseerQuickAction hsplit<CR>", desc = "Open task in a hsplit" }, { "<leader>pO", "<CMD>OverseerQuickAction hsplit<CR>", desc = "Open task in a hsplit" },
{ {
"<leader>pQ", "<leader>pQ",
"<CMD>OverseerQuickAction close win<CR><CMD>OverseerQuickAction dispose<CR>", "<CMD>OverseerQuickAction close win<CR><CMD>OverseerQuickAction dispose<CR>",
desc = "Close and dispose task's windows", desc = "Close and dispose task's windows",
}, },
{ "<leader>pW", "<CMD>OverseerQuickAction unwatch<CR>", desc = "Unwatch task" }, { "<leader>pW", "<CMD>OverseerQuickAction unwatch<CR>", desc = "Unwatch task" },
{ "<leader>pf", "<CMD>OverseerQuickAction open float<CR>", desc = "Open task in a float window" }, { "<leader>pf", "<CMD>OverseerQuickAction open float<CR>", desc = "Open task in a float window" },
{ "<leader>pl", "<CMD>OverseerLoadBundle<CR>", desc = "Load tasks" }, { "<leader>pl", "<CMD>OverseerLoadBundle<CR>", desc = "Load tasks" },
{ "<leader>pm", "<CMD>OverseerTaskAction<CR>", desc = "Manage task" }, { "<leader>pm", "<CMD>OverseerTaskAction<CR>", desc = "Manage task" },
{ "<leader>po", "<CMD>OverseerQuickAction vsplit<CR>", desc = "Open task in a vsplit" }, { "<leader>po", "<CMD>OverseerQuickAction vsplit<CR>", desc = "Open task in a vsplit" },
{ "<leader>pp", "<CMD>OverseerRun<CR>", desc = "Run task" }, { "<leader>pp", "<CMD>OverseerRun<CR>", desc = "Run task" },
{ "<leader>pq", "<CMD>OverseerQuickAction close win<CR>", desc = "Close task's windows" }, { "<leader>pq", "<CMD>OverseerQuickAction close win<CR>", desc = "Close task's windows" },
{ "<leader>ps", "<CMD>OverseerSaveBundle<CR>", desc = "Save tasks" }, { "<leader>ps", "<CMD>OverseerSaveBundle<CR>", desc = "Save tasks" },
{ "<leader>pt", "<CMD>OverseerToggle<CR>", desc = "Toggle tasks list" }, { "<leader>pt", "<CMD>OverseerToggle<CR>", desc = "Toggle tasks list" },
{ "<leader>pw", "<CMD>OverseerQuickAction watch<CR>", desc = "Watch task" }, { "<leader>pw", "<CMD>OverseerQuickAction watch<CR>", desc = "Watch task" },
}, },
opts = { opts = {
actions = { actions = {

View file

@ -1,24 +1,80 @@
return { return {
"folke/trouble.nvim", "folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" }, dependencies = { "nvim-tree/nvim-web-devicons" },
cmd = { "TroubleToggle", "Trouble" }, cmd = { "Trouble" },
keys = { keys = {
{ "<leader>fq", "<CMD>TroubleToggle<CR>", desc = "Toggle trouble" },
{ "<leader>fd", "<CMD>TroubleToggle workspace_diagnostics<CR>", desc = "Find diagnostics" },
{ {
"<leader>fD", "<leader>fD",
"<CMD>TroubleToggle document_diagnostics<CR>", "<cmd>Trouble diagnostics open<cr>",
desc = "Find diagnostics in workspace", desc = "Find diagnostics (Trouble)",
},
{
"<leader>fd",
"<cmd>Trouble diagnostics open filter.buf=0<cr>",
desc = "Find buffer diagnostics (Trouble)",
},
{
"<leader>ll",
"<cmd>Trouble symbols open<cr>",
desc = "Symbols (Trouble)",
},
{
"<leader>li",
"<cmd>Trouble lsp open<cr>",
desc = "LSP info of node (Trouble)",
},
{
"<leader>fq",
"<cmd>Trouble qflist open<cr>",
desc = "Quickfix List (Trouble)",
}, },
}, },
config = function() opts = function()
require("trouble").setup({ ---@type trouble.Window.opts
mode = "document_diagnostics", local win_opts = {
action_keys = { -- size = { width = 30, height = 0.5 },
open_split = "s", minimal = true,
open_vsplit = "v", border = "rounded",
open_tab = "t", position = "bottom",
}
---@type trouble.Config
return {
focus = false,
---@type trouble.Window.opts
preview = {
type = "split",
relative = "win",
position = "top",
}, },
})
end, ---@type table<string, trouble.Action.spec|false>
keys = {
["<cr>"] = "jump_close",
["<2-leftmouse>"] = "jump_close",
["<c-v>"] = "jump_split_close",
["<c-s>"] = "jump_vsplit_close",
["v"] = "jump_split_close",
["s"] = "jump_vsplit_close",
["<c-k>"] = "cancel", -- hack to fool myself into thinking I move to the avobe window
},
win = win_opts,
---@type table<string, trouble.Mode>
modes = {
symbols = {
focus = true,
win = win_opts
},
lsp_references = {
focus = true,
win = win_opts
},
lsp = {
focus = true,
win = win_opts
},
}
}
end
} }