Core AstroNvim configuration engine
Repo AstroNvim/astrocore, read from GitHub 5 h ago. AstroNvim has not joined Take My Repo.
AstroNvim/astrocore is a public repo on GitHub by AstroNvim. Core AstroNvim configuration engine. It declares the GPL-3.0 license on GitHub. It is written mainly in Lua, has 62 stars and last changed on 2026-10-29. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-22.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
AstroCore provides the core Lua API that powers AstroNvim. It provides an interface for configuration auto commands, user commands, on_key functions, key mappings, and more as well as a Lua API of common utility functions.
tablinecd featuresnvim-treesitter features: the tree-sitter CLI, or mason.nvim so AstroCore can install tree-sitter-cli.Install the plugin with the lazy plugin manager:
return {
"AstroNvim/astrocore",
lazy = false, -- disable lazy loading
priority = 10000, -- load AstroCore first
opts = {
-- set configuration options as described below
},
}
💡 If you want to enable session management with resession.nvim, enable it in the setup:
require("resession").setup {
extensions = {
astrocore = {},
},
}
AstroCore provides defaults that can be overridden through the opts table in lazy. Here are descriptions of the options and some example usages:
---@type AstroCoreOpts
local opts = {
-- easily configure auto commands
autocmds = {
-- first key is the `augroup` (:h augroup)
highlighturl = {
-- list of auto commands to set
{
-- events to trigger
event = { "VimEnter", "FileType", "BufEnter", "WinEnter" },
-- the rest of the autocmd options (:h nvim_create_autocmd)
desc = "URL Highlighting",
callback = function() require("astrocore").set_url_match() end,
},
},
},
-- easily configure user commands
commands = {
-- key is the command name
AstroReload = {
-- first element with no key is the command (string or function)
function() require("astrocore").reload() end,
-- the rest are options for creating user commands (:h nvim_create_user_command)
desc = "Reload AstroNvim (Experimental)",
},
},
-- Configure diagnostics options (`:h vim.diagnostic.config()`)
diagnostics = {
update_in_insert = false,
},
-- passed to `vim.filetype.add`
filetypes = {
-- see `:h vim.filetype.add` for usage
extension = {
foo = "fooscript",
},
filename = {
[".foorc"] = "fooscript",
},
pattern = {
[".*/etc/foo/.*"] = "fooscript",
},
},
-- Configuration of vim mappings to create
mappings = {
-- map mode (:h map-modes)
n = {
-- use vimscript strings for mappings
["<C-s>"] = { ":w!<cr>", desc = "Save File" },
-- 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",
},
-- 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" },
},
},
-- easily configure functions on key press
on_keys = {
-- first key is the namespace
auto_hlsearch = {
-- list of functions to execute on key press (:h vim.on_key)
function(char) -- example automatically disables `hlsearch` when not actively searching
if vim.fn.mode() == "n" then
local new_hlsearch = vim.tbl_contains({ "<CR>", "n", "N", "*", "#", "?", "/" }, vim.fn.keytrans(char))
if vim.opt.hlsearch:get() ~= new_hlsearch then vim.opt.hlsearch = new_hlsearch end
end
end,
},
},
-- easily configure vim options
options = {
-- first key is the type of option `vim.<first_key>`
opt = {
relativenumber = true, -- sets `vim.opt.relativenumber`
signcolumn = "auto", -- sets `vim.opt.signcolumn`
},
g = {
-- set global `vim.g` settings here
},
},
-- configure AstroNvim features
features = {
autopairs = true, -- enable or disable autopairs on start
cmp = true, -- enable or disable cmp on start
diagnostics = { virtual_text = true, virtual_lines = false }, -- enable or disable diagnostics features on start
highlighturl = true, -- enable or disable highlighting of urls on start
-- table for defining the size of the max file for all features, above these limits we disable features like treesitter.
large_buf = {
-- whether to enable large file detection for a buffer (must return false to disable)
-- first parameter is the buffer number, the second is the large buffer configuration table
-- return values:
-- - `true` or `nil` to continue and respects all changes made to the large buffer configuration table
-- - `false` to disable large file detection for the buffer
-- - a new table of large buffer options to use instead of the defaults
enabled = function(bufnr, config) end,
notify = true, -- whether or not to display a notification when a large file is detected
size = 1024 * 100, -- max file size (or false to disable check)
lines = 10000, -- max number of lines (or false to disable check)
line_length = 1000, -- average line length (or false to disable check)
},
notifications = true, -- enable or disable notifications on start
},
-- Enable git integration for detached worktrees
git_worktrees = {
{ toplevel = vim.env.HOME, gitdir = vim.env.HOME .. "/.dotfiles" },
},
-- Configure project root detection, check status with `:AstroRootInfo`
rooter = {
-- list of detectors in order of prevalence, elements can be:
-- "lsp" : lsp detection
-- string[] : a list of directory patterns to look for
-- fun(bufnr: integer): string|string[] : a function that takes a buffer number and outputs detected roots
detector = {
"lsp", -- highest priority is getting workspace from running language servers
{ ".git", "_darcs", ".hg", ".bzr", ".svn" }, -- next check for a version controlled parent directory
{ "lua", "Makefile", "package.json" }, -- lastly check for known project root files
},
-- ignore things from root detection
ignore = {
servers = {}, -- list of language server names to ignore (Ex. { "efm" })
dirs = {}, -- list of directory patterns (Ex. { "^" .. vim.pesc(vim.fn.expand "~/.cargo/") })
},
-- automatically update working directory (update manually with `:AstroRoot`)
autochdir = false,
-- scope of working directory to change ("global"|"tab"|"win")
scope = "global",
-- show notification on every working directory change
notify = false,
},
-- Configuration table of session options for AstroNvim's session management powered by Resession
sessions = {
-- Configure auto saving
autosave = {
last = true, -- auto save last session
cwd = true, -- auto save session for each working directory
},
-- Patterns to ignore when saving sessions
ignore = {
dirs = {}, -- working directories to ignore sessions in
filetypes = { "gitcommit", "gitrebase" }, -- filetypes to ignore sessions
buftypes = {}, -- buffer types to ignore sessions
},
},
-- Configuration of treesitter features in Neovim
treesitter = {
-- Globally enable or disable treesitter features
-- can be a boolean or a function (`fun(lang: string, bufnr: integer): boolean`)
enabled = true,
-- Enable or disable treesitter based highlighting
-- can be a boolean, list of parsers, or a function (`fun(lang: string, bufnr: integer): boolean`)
highlight = true,
-- Enable or disable treesitter based indenting
-- can be a boolean, list of parsers, or a function (`fun(lang: string, bufnr: integer): boolean`)
indent = true,
-- List of treesitter parsers that should be installed automatically
-- ("all" can be used to install all available parsers)
ensure_installed = { "lua", "vim", "vimdoc" },
-- Automatically detect missing treesitter parser and install when editing file
auto_install = false,
-- Automatically detect missing treesitter CLI and install it with Mason if needed
auto_install_cli = true,
-- Configure treesitter based text objects
textobjects = {
select = {
select_textobject = {
["af"] = { query = "@function.outer", desc = "around function" },
["if"] = { query = "@function.inner", desc = "around function" },
},
},
move = {
goto_next_start = {
["]f"] = { query = "@function.outer", desc = "Next function start" },
},
goto_next_end = {
["]F"] = { query = "@function.outer", desc = "Next function end" },
},
goto_previous_start = {
["[f"] = { query = "@function.outer", desc = "Previous function start" },
},
goto_previous_end = {
["[F"] = { query = "@function.outer", desc = "Previous function end" },
},
},
swap = {
swap_next = {
[">F"] = { query = "@function.outer", desc = "Swap next function" },
},
swap_previous = {
["<F"] = { query = "@function.outer", desc = "Swap previous function" },
},
},
},
},
}
AstroCore provides a Lua API with utility functions. This can be viewed with :h astrocore or in the repository at doc/api.md
If you plan to contribute, please check the contribution guidelines first.
AstroNvim/astrocore is a public repo on GitHub by AstroNvim. Core AstroNvim configuration engine.
It declares the GPL-3.0 license on GitHub.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2026-10-29. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
AstroNvim is an aesthetic and feature-rich neovim config that is extensible and easy to use with a great set of plugins
A community repository of common plugin specifications
