mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-21 00:25:42 +02:00
plugins/languages: move to by-name
This commit is contained in:
parent
9d323f3ec7
commit
b1d0959bc9
71 changed files with 19 additions and 36 deletions
88
plugins/by-name/vimtex/default.nix
Normal file
88
plugins/by-name/vimtex/default.nix
Normal file
|
@ -0,0 +1,88 @@
|
|||
{
|
||||
lib,
|
||||
helpers,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
with lib;
|
||||
helpers.vim-plugin.mkVimPlugin {
|
||||
name = "vimtex";
|
||||
globalPrefix = "vimtex_";
|
||||
|
||||
maintainers = [ maintainers.GaetanLepage ];
|
||||
|
||||
extraPackages = [ pkgs.pstree ];
|
||||
|
||||
# TODO introduced 2024-02-20: remove 2024-04-20
|
||||
deprecateExtraConfig = true;
|
||||
optionsRenamedToSettings = [ "viewMethod" ];
|
||||
imports =
|
||||
let
|
||||
basePluginPath = [
|
||||
"plugins"
|
||||
"vimtex"
|
||||
];
|
||||
in
|
||||
[
|
||||
(mkRemovedOptionModule (
|
||||
basePluginPath ++ [ "installTexLive" ]
|
||||
) "If you don't want `texlive` to be installed, set `plugins.vimtex.texlivePackage` to `null`.")
|
||||
(mkRenamedOptionModule (basePluginPath ++ [ "texLivePackage" ]) (
|
||||
basePluginPath ++ [ "texlivePackage" ]
|
||||
))
|
||||
];
|
||||
|
||||
settingsOptions = {
|
||||
view_method = mkOption {
|
||||
type = types.str;
|
||||
default = "general";
|
||||
example = "zathura";
|
||||
description = ''
|
||||
Set the viewer method.
|
||||
By default, a generic viewer is used through the general view method (e.g. `xdg-open` on Linux).
|
||||
'';
|
||||
};
|
||||
};
|
||||
|
||||
settingsExample = {
|
||||
view_method = "zathura";
|
||||
compiler_method = "latexrun";
|
||||
toc_config = {
|
||||
split_pos = "vert topleft";
|
||||
split_width = 40;
|
||||
};
|
||||
};
|
||||
|
||||
extraOptions = {
|
||||
texlivePackage = lib.mkPackageOption pkgs "texlive" {
|
||||
nullable = true;
|
||||
default = [
|
||||
"texlive"
|
||||
"combined"
|
||||
"scheme-medium"
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
extraConfig = cfg: {
|
||||
plugins.vimtex.settings = {
|
||||
enabled = true;
|
||||
callback_progpath = "nvim";
|
||||
};
|
||||
|
||||
extraPackages =
|
||||
let
|
||||
# xdotool does not exist on darwin
|
||||
xdotool = optional pkgs.stdenv.isLinux pkgs.xdotool;
|
||||
viewerPackages =
|
||||
{
|
||||
general = xdotool;
|
||||
zathura = xdotool ++ [ pkgs.zathura ];
|
||||
zathura_simple = [ pkgs.zathura ];
|
||||
mupdf = xdotool ++ [ pkgs.mupdf ];
|
||||
}
|
||||
.${cfg.settings.view_method} or [ ];
|
||||
in
|
||||
[ cfg.texlivePackage ] ++ viewerPackages;
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue