astronixvim/plugins/astrocore.nix

78 lines
2.7 KiB
Nix
Raw Normal View History

{pkgs, lib,...}: let
2025-11-21 22:08:37 +01:00
inherit (lib.nixvim.lua) toLuaObject;
options = {
features = {
2025-11-21 22:08:37 +01:00
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
2025-11-21 22:08:37 +01:00
diagnostics = { virtual_text = true; virtual_lines = false; }; # diagnostic settings on startup
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;
};
# passed to `vim.filetype.add`
# filetypes = {
# # see `:h vim.filetype.add` for usage
# extension = {
# foo = "fooscript";
# };
# filename = {
# [".foorc"] = "fooscript";
# };
# pattern = {
# [".*/etc/foo/.*"] = "fooscript";
# };
# };
2025-11-21 22:08:37 +01:00
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. { "~/.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 = true;
};
sessions = {
autosave = {
last = true; # autosave last session
cwd = true; # auosave session for each working dir
};
# 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
};
};
mappings = {
n = {
"<Leader>b" = { desc = "Buffers"; };
};
};
};
in {
extraPlugins = [pkgs.vimPlugins.astrocore];
extraConfigLua = /*lua*/ ''
require('astrocore').setup(${toLuaObject options})
2025-11-21 22:08:37 +01:00
'';
}