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

@@ -8,6 +8,11 @@ return {
{ import = 'astrocommunity.colorscheme.tokyonight-nvim' },
{ import = 'astrocommunity.pack.lua' },
{ import = 'astrocommunity.editing-support.conform-nvim' },
{ import = 'astrocommunity.git.diffview-nvim' },
{ import = 'astrocommunity.pack.go' },
{ import = 'astrocommunity.pack.lua' },
{ import = 'astrocommunity.test.neotest' },
}

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" },

View File

@@ -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)

View File

@@ -16,6 +16,7 @@ return {
-- Normal = { bg = "#000000" },
},
},
folding = false,
-- Icons can be configured throughout the interface
icons = {
-- configure the loading of the lsp in the status line

View File

@@ -0,0 +1,9 @@
return {
'greggh/claude-code.nvim',
dependencies = {
'nvim-lua/plenary.nvim',
},
config = function()
require('claude-code').setup()
end,
}

View File

@@ -1,47 +0,0 @@
return {
'karb94/neoscroll.nvim',
config = function()
local neoscroll = require 'neoscroll'
neoscroll.setup {
mappings = {
'<C-u>',
'<C-d>',
'<C-b>',
'<C-f>',
'zt',
'zz',
'zb',
},
easing = 'circ',
respect_scrolloff = true,
}
local keymap = {
['<C-u>'] = function()
neoscroll.ctrl_u { duration = 200 }
end,
['<C-d>'] = function()
neoscroll.ctrl_d { duration = 200 }
end,
['<C-b>'] = function()
neoscroll.ctrl_b { duration = 300 }
end,
['<C-f>'] = function()
neoscroll.ctrl_f { duration = 300 }
end,
['zt'] = function()
neoscroll.zt { half_win_duration = 100 }
end,
['zz'] = function()
neoscroll.zz { half_win_duration = 100 }
end,
['zb'] = function()
neoscroll.zb { half_win_duration = 100 }
end,
}
local modes = { 'n', 'v', 'x' }
for key, func in pairs(keymap) do
vim.keymap.set(modes, key, func)
end
end,
}