add a bunch of essential plugins

This commit is contained in:
Natercio Moniz
2025-08-26 20:19:13 +01:00
parent a2d266132c
commit 4d7c7b7c9e
6 changed files with 94 additions and 82 deletions

View File

@@ -10,12 +10,12 @@ return {
opts = {
-- Configure core features of AstroNvim
features = {
large_buf = { size = 1024 * 256, lines = 10000 }, -- set global limits for large files for disabling features like treesitter
autopairs = true, -- enable autopairs at start
cmp = true, -- enable completion at start
large_buf = { size = 1024 * 256, lines = 10000 }, -- set global limits for large files for disabling features like treesitter
autopairs = true, -- enable autopairs at start
cmp = true, -- enable completion at start
diagnostics = { virtual_text = true, virtual_lines = false }, -- diagnostic settings on startup
highlighturl = true, -- highlight URLs at start
notifications = true, -- enable notifications at start
highlighturl = true, -- highlight URLs at start
notifications = true, -- enable notifications at start
},
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
diagnostics = {
@@ -37,14 +37,14 @@ return {
},
-- vim options can be configured here
options = {
opt = { -- vim.opt.<key>
opt = { -- vim.opt.<key>
relativenumber = true, -- sets vim.opt.relativenumber
number = true, -- sets vim.opt.number
spell = false, -- sets vim.opt.spell
signcolumn = 'yes', -- sets vim.opt.signcolumn to yes
wrap = false, -- sets vim.opt.wrap
number = true, -- sets vim.opt.number
spell = false, -- sets vim.opt.spell
signcolumn = 'yes', -- sets vim.opt.signcolumn to yes
wrap = false, -- sets vim.opt.wrap
},
g = { -- vim.g.<key>
g = { -- vim.g.<key>
-- configure global vim variables (vim.g)
-- NOTE: `mapleader` and `maplocalleader` must be set in the AstroNvim opts or before `lazy.setup`
-- This can be found in the `lua/lazy_setup.lua` file
@@ -83,14 +83,22 @@ return {
['<Leader>xq'] = {
function()
local qf_open = vim.tbl_isempty(vim.tbl_filter(function(win)
return win.quickfix == 1
end, vim.fn.getwininfo()))
local win_id
for _, win in ipairs(vim.fn.getwininfo()) do
if win.quickfix == 1 then
win_id = win.winid
break
end
end
if qf_open then
vim.cmd.copen()
if win_id then
if vim.api.nvim_get_current_win() ~= win_id then
vim.api.nvim_set_current_win(win_id)
else
vim.cmd.cclose()
end
else
vim.cmd.cclose()
vim.cmd.copen()
end
end,
desc = 'Toggle Quickfix list',
@@ -98,12 +106,20 @@ return {
['<Leader>xl'] = {
function()
local ll_open = vim.tbl_isempty(vim.tbl_filter(function(win)
return win.loclist == 1
end, vim.fn.getwininfo()))
local win_id
for _, win in ipairs(vim.fn.getwininfo()) do
if win.loclist == 1 then
win_id = win.winid
break
end
end
if ll_open then
vim.cmd.lclose()
if win_id then
if vim.api.nvim_get_current_win() ~= win_id then
vim.api.nvim_set_current_win(win_id)
else
vim.cmd.lclose()
end
else
vim.cmd.lopen()
end
@@ -111,6 +127,27 @@ return {
desc = 'Toggle Local list',
},
['<Leader>tr'] = {
function()
require('neotest').run.run()
end,
desc = 'Test: run nearest test',
},
['<Leader>td'] = {
function()
require('neotest').run.run { strategy = 'dap' }
end,
desc = 'Test: debug nearest test',
},
['<Leader>ta'] = {
function()
require('neotest').run.run(vim.fn.expand '%')
end,
desc = 'Test: run all test in file',
},
-- tables with just a `desc` key will be registered with which-key if it's installed
-- this is useful for naming menus
-- ["<Leader>b"] = { desc = "Buffers" },