refactor: removing needless module complexity

This commit is contained in:
cnst
2024-10-27 09:14:34 +01:00
parent d8f810ee05
commit 4887feccfd
175 changed files with 920 additions and 1118 deletions

View File

@@ -0,0 +1,78 @@
{
lib,
config,
...
}: let
inherit (lib) mkEnableOption mkIf;
cfg = config.home.devtools.nixvim.plugins.vimtex;
in {
options = {
home.devtools.nixvim.plugins.vimtex.enable = mkEnableOption "Enables VimTeX plugin for nixvim";
};
config = mkIf cfg.enable {
programs.nixvim = {
plugins.vimtex = {
enable = true;
settings = {
view_method = "zathura";
quickfix_enabled = true;
quickfix_open_on_warning = false;
quickfix_ignore_filters = [
"Underfull"
"Overfull"
"specifier changed to"
"Token not allowed in a PDF string"
];
toc_config = {
name = "TOC";
layers = ["content" "todo"];
resize = true;
split_width = 50;
todo_sorted = false;
show_help = true;
show_numbers = true;
mode = 2;
};
};
};
files."after/ftplugin/tex.lua".keymaps = [
{
mode = "n";
key = "m";
action = ":VimtexView<cr>";
}
];
autoCmd = [
{
event = ["BufEnter" "BufWinEnter"];
pattern = "*.tex";
command = "set filetype=tex \"| VimtexTocOpen";
}
{
event = "FileType";
pattern = ["tex" "latex"];
callback = ''
function ()
vim.o.foldmethod = 'expr'
vim.o.foldexpr = 'vimtex#fold#level(v:lnum)'
vim.o.foldtext = 'vimtex#fold#text()'
end
'';
}
{
event = "User";
pattern = "VimtexEventInitPost";
callback = "vimtex#compiler#compile";
}
{
event = "User";
pattern = "VimtexEventQuit";
command = "call vimtex#compiler#clean(0)";
}
];
};
};
}