Update config to astronvim V6

This commit is contained in:
2026-05-05 21:55:42 -03:00
parent 5c7bbd33cd
commit 200f428b3c
24 changed files with 252 additions and 566 deletions

View File

@@ -10,21 +10,12 @@ return {
"AstroNvim/astrocore",
---@type AstroCoreOpts
opts = {
sessions = {
autosave = {
last = true,
cwd = true,
},
ignore = {
dirs = { "wiki" },
},
},
-- Configure core features of AstroNvim
features = {
large_buf = { size = 1024 * 500, lines = 10000 }, -- set global limits for large files for disabling features like treesitter
large_buf = { size = 1024 * 256, lines = 10000 }, -- set global limits for large files for disabling features like treesitter
autopairs = false, -- enable autopairs at start
cmp = true, -- enable completion at start
diagnostics_mode = 3, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on)
diagnostics = { virtual_text = true, virtual_lines = false }, -- diagnostic settings on startup
highlighturl = true, -- highlight URLs at start
notifications = true, -- enable notifications at start
},
@@ -33,13 +24,26 @@ return {
virtual_text = true,
underline = true,
},
-- passed to `vim.filetype.add`
filetypes = {
-- see `:h vim.filetype.add` for usage
extension = {
foo = "fooscript",
},
filename = {
[".foorc"] = "fooscript",
},
pattern = {
[".*/etc/foo/.*"] = "fooscript",
},
},
-- vim options can be configured here
options = {
opt = { -- vim.opt.<key>
relativenumber = true, -- sets vim.opt.relativenumber
number = true, -- sets vim.opt.number
spell = false, -- sets vim.opt.spell
signcolumn = "auto", -- sets vim.opt.signcolumn to auto
signcolumn = "yes", -- sets vim.opt.signcolumn to yes
wrap = false, -- sets vim.opt.wrap
expandtab = false,
cursorline = false,
@@ -54,20 +58,20 @@ return {
-- 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
mapleader = " ", -- sets vim.g.mapleader
autoformat_enabled = false, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
cmp_enabled = true, -- enable completion at start
autopairs_enabled = false, -- enable autopairs at start
diagnostics_mode = 3, -- set the visibility of diagnostics in the UI (0=off, 1=only show in status line, 2=virtual text off, 3=all on)
icons_enabled = true, -- disable icons in the UI (disable if no nerd font is available, requires :PackerSync after changing)
autoformat_enabled = false, -- enable or disable auto formatting at start (lsp.formatting.format_on_save must be enabled)
autopairs_enabled = false, -- enable autopairs at start
ui_notifications_enabled = true, -- disable notifications when toggling UI elements
c_syntax_for_h = 1,
wiki_root = '~/Documentos/Wiki',
-- vimtex
-- Vimtex
vimtex_view_method = "zathura",
vimtex_compiler_latexmk = {
aux_dir = "/run/user/1000/vimtex"
aux_dir = "/run/user/1000/vimtex-aux"
},
-- wiki
-- Wiki
wiki_root = '~/Documentos/Wiki',
wiki_journal = {
name = "journal",
frequency = "daily",
@@ -90,6 +94,26 @@ return {
n = {
-- second key is the lefthand side of the map
-- navigate buffer tabs
["]b"] = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
["[b"] = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
-- mappings seen under group name "Buffer"
["<Leader>bd"] = {
function()
require("astroui.status.heirline").buffer_picker(
function(bufnr) require("astrocore.buffer").close(bufnr) end
)
end,
desc = "Close buffer from tabline",
},
-- 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" },
-- setting a mapping to false will disable it
-- ["<C-S>"] = false,
-- navigate buffer tabs with `H` and `L`
L = { function() require("astrocore.buffer").nav(vim.v.count1) end, desc = "Next buffer" },
H = { function() require("astrocore.buffer").nav(-vim.v.count1) end, desc = "Previous buffer" },
@@ -154,8 +178,6 @@ return {
["<Leader>b"] = { desc = "Buffers" },
-- quick save
-- ["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
n = { utils.better_search "n", desc = "Next search" },
N = { utils.better_search "N", desc = "Previous search" },
["<Up>"] = { function() require("smart-splits").resize_up(2) end, desc = "Resize split up" },
["<Down>"] = { function() require("smart-splits").resize_down(2) end, desc = "Resize split down" },
["<Left>"] = { function() require("smart-splits").resize_left(2) end, desc = "Resize split left" },
@@ -290,26 +312,6 @@ return {
["<C-s>"] = { ":w!<cr>", desc = "Save File" }, -- change description but the same command
["<C-l>"] = { function() require("luasnip").jump(1) end, desc = "Jump to next snippet" },
},
v = {
["<Leader>s"] = { function() require("spectre").open_visual() end, desc = "Spectre" },
},
t = {
-- setting a mapping to false will disable it
-- ["<esc>"] = false,
},
x = {
-- better increment/decrement
["+"] = { "g<C-a>", desc = "Increment number" },
["-"] = { "g<C-x>", desc = "Descrement number" },
-- Easy-Align
ga = { "<Plug>(EasyAlign)", desc = "Easy Align" },
},
o = {
-- line text-objects
["il"] = { ":normal vil<cr>", desc = "Inside line text object" },
["al"] = { ":normal val<cr>", desc = "Around line text object" },
},
},
},
}