nvim-config/lua/plugins/astrocore.lua

122 lines
4.3 KiB
Lua

---@type LazySpec
return {
"AstroNvim/astrocore",
---@diagnostic disable-next-line: undefined-doc-name
---@type AstroCoreOpts
opts = {
-- Configure core features of AstroNvim
features = {
large_buf = { size = 1024 * 500, 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_mode = 3, -- diagnostic mode on start (0 = off, 1 = no signs/virtual text, 2 = no virtual text, 3 = on)
highlighturl = true, -- highlight URLs at start
notifications = true, -- enable notifications at start
},
-- Diagnostics configuration (for vim.diagnostics.config({...})) when diagnostics are on
diagnostics = {
virtual_text = true,
underline = true,
},
-- vim options can be configured here
options = {
opt = { -- vim.opt.<key>
spell = false, -- sets vim.opt.spell
signcolumn = "auto", -- sets vim.opt.signcolumn to auto
wrap = false, -- sets vim.opt.wrap
colorcolumn = "80",
relativenumber = true,
tabstop = 4,
completeopt = { "menu", "menuone", "longest", "preview", "noselect" },
ignorecase = true,
smartcase = true,
whichwrap = "<,>,[,],b,h,l,s",
scrolloff = 10,
spelllang = "en",
foldlevel = 99,
foldlevelstart = 99,
foldenable = true,
diffopt = "internal,filler,closeoff,iwhite,linematch:60",
sessionoptions = "blank,buffers,curdir,folds,help,tabpages,winsize,winpos,terminal,localoptions",
},
g = { -- vim.g.<key>
neovide_remember_window_size = true,
neovide_hide_mouse_when_typing = true,
better_whitespace_filetypes_blacklist = {
"diff",
"git",
"gitcommit",
"unite",
"qf",
"help",
"markdown",
"fugitive",
"terminal",
"toggleterm",
"nofile",
}
},
o = { -- vim.o.<key>
guifont = "JetBrainsMono NFM:h13",
},
},
-- Mappings can be configured through AstroCore as well.
-- NOTE: keycodes follow the casing in the vimdocs. For example, `<Leader>` must be capitalized
---@diagnostic disable: missing-fields
mappings = {
-- first key is the mode
n = {
-- 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" },
-- mappings seen under group name "Buffer"
-- 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" },
["<Leader>bD"] = {
function()
require("astroui.status.heirline").buffer_picker(
function(bufnr) require("astrocore.buffer").close(bufnr) end
)
end,
desc = "Pick to close",
},
["<C-d>"] = "12<C-e>",
["<C-u>"] = "12<C-y>",
["<M-h>"] = "26zh",
["<M-l>"] = "26zl",
["<C-a>"] = "ggVG",
["<S-ScrollWheelUp>"] = "26zh",
["<S-ScrollWheelDown>"] = "26zl",
["zn"] = { "zR", desc = "Open all folds" },
[","] = { function() require("notify").dismiss {} end },
["<Leader><tab>"] = { "<cmd>b#<cr>", desc = "Recent buffer" },
["<Leader>px"] = { function() require("lazy").clean() end, desc = "Packer Clean" },
["<Leader>x"] = { "<cmd>Hexmode<cr>", desc = "Hexmode" },
["<Leader>r"] = { name = " Repl" },
["<Leader>rr"] = { "<cmd>Repl<cr>", desc = "Repl" },
["<Leader>ra"] = { "<cmd>ReplAuto<cr>", desc = "Auto" },
["<Leader>rl"] = { "<cmd>ReplList<cr>", desc = "List" },
["<Leader>rc"] = { "<cmd>ReplRecv<cr>", desc = "Receive" },
["<Leader>rs"] = { "<cmd>ReplSend<cr>", desc = "Send" },
["<Leader>rq"] = { "<cmd>ReplStop<cr>", desc = "Stop" },
},
i = {
["<C-v>"] = "<C-r>+",
["<C-s>"] = "<cmd>w<cr>",
},
t = {
["<C-v>"] = "<C-r>+",
},
c = {
["<C-v>"] = "<C-r>+",
},
["!"] = {
["<C-v>"] = "<C-r>+",
},
},
},
}