mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 17:28:39 +02:00
Adds view method option to vimtex and allows the installation of texlive with the plugin (#637)
This commit is contained in:
parent
fc5bbc733c
commit
c5150bfcdc
1 changed files with 33 additions and 2 deletions
|
@ -24,6 +24,25 @@ in
|
|||
'';
|
||||
default = {};
|
||||
};
|
||||
|
||||
viewMethod = mkOption {
|
||||
type = types.str;
|
||||
description = ''
|
||||
The view method that vimtex will use to display PDF's.
|
||||
Check https://github.com/lervag/vimtex/blob/03c83443108a6984bf90100f6d00ec270b84a339/doc/vimtex.txt#L3322
|
||||
for more information.
|
||||
'';
|
||||
default = "general";
|
||||
};
|
||||
installTexLive = mkOption {
|
||||
type = types.bool;
|
||||
description = ''
|
||||
Whether or not to install TexLive.
|
||||
See https://nixos.wiki/wiki/TexLive.
|
||||
'';
|
||||
default = false;
|
||||
};
|
||||
texLivePackage = helpers.mkPackageOption "texLivePackage" pkgs.texlive.combined.scheme-medium;
|
||||
};
|
||||
|
||||
config = let
|
||||
|
@ -31,14 +50,26 @@ in
|
|||
{
|
||||
enabled = cfg.enable;
|
||||
callback_progpath = "nvim";
|
||||
view_method = cfg.viewMethod;
|
||||
}
|
||||
// cfg.extraConfig;
|
||||
basePackages =
|
||||
[pkgs.pstree]
|
||||
++ (
|
||||
lib.optional cfg.installTexLive cfg.texLivePackage
|
||||
);
|
||||
viewMethodAndPDFViewerPairs = {
|
||||
general = [pkgs.xdotool];
|
||||
zathura = [pkgs.xdotool pkgs.zathura];
|
||||
zathura_simple = [pkgs.zathura];
|
||||
mupdf = [pkgs.xdotool pkgs.mupdf];
|
||||
};
|
||||
in
|
||||
mkIf cfg.enable {
|
||||
extraPlugins = [cfg.package];
|
||||
|
||||
# Usefull for inverse search
|
||||
extraPackages = with pkgs; [pstree xdotool];
|
||||
extraPackages =
|
||||
basePackages ++ (lib.optionals (hasAttr "${cfg.viewMethod}" viewMethodAndPDFViewerPairs) viewMethodAndPDFViewerPairs."${cfg.viewMethod}");
|
||||
|
||||
globals = mapAttrs' (name: nameValuePair ("vimtex_" + name)) globals;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue