mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-24 09:48:42 +02:00
vimtex: init plugin (#146)
This commit is contained in:
parent
13943b4ab2
commit
9cca0b1fc9
2 changed files with 43 additions and 0 deletions
|
@ -30,6 +30,7 @@
|
||||||
./languages/treesitter.nix
|
./languages/treesitter.nix
|
||||||
./languages/treesitter-context.nix
|
./languages/treesitter-context.nix
|
||||||
./languages/treesitter-refactor.nix
|
./languages/treesitter-refactor.nix
|
||||||
|
./languages/vimtex.nix
|
||||||
./languages/zig.nix
|
./languages/zig.nix
|
||||||
|
|
||||||
./null-ls
|
./null-ls
|
||||||
|
|
42
plugins/languages/vimtex.nix
Normal file
42
plugins/languages/vimtex.nix
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
{ pkgs
|
||||||
|
, lib
|
||||||
|
, config
|
||||||
|
, ...
|
||||||
|
}:
|
||||||
|
let
|
||||||
|
cfg = config.plugins.vimtex;
|
||||||
|
helpers = import ../helpers.nix { inherit lib; };
|
||||||
|
in
|
||||||
|
with lib;
|
||||||
|
{
|
||||||
|
options.plugins.vimtex = {
|
||||||
|
|
||||||
|
enable = mkEnableOption "vimtex";
|
||||||
|
|
||||||
|
package = helpers.mkPackageOption "vimtex" pkgs.vimPlugins.vimtex;
|
||||||
|
|
||||||
|
extraConfig = helpers.mkNullOrOption types.attrs ''
|
||||||
|
The configuration options for vimtex without the 'vimtex_' prefix.
|
||||||
|
Example: To set 'vimtex_compiler_enabled' to 1, write
|
||||||
|
extraConfig = {
|
||||||
|
compiler_enabled = true;
|
||||||
|
};
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
|
config =
|
||||||
|
let
|
||||||
|
globals = {
|
||||||
|
enabled = cfg.enable;
|
||||||
|
} // cfg.extraConfig;
|
||||||
|
in
|
||||||
|
mkIf cfg.enable {
|
||||||
|
|
||||||
|
extraPlugins = [ cfg.package ];
|
||||||
|
|
||||||
|
# Usefull for inverse search
|
||||||
|
extraPackages = with pkgs; [ pstree xdotool ];
|
||||||
|
|
||||||
|
globals = mapAttrs' (name: value: nameValuePair ("vimtex_" + name) value) globals;
|
||||||
|
};
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue