mirror of
https://github.com/NotAShelf/nvf.git
synced 2026-04-27 11:55:22 +00:00
Some checks are pending
Set up binary cache / cachix (default) (push) Waiting to run
Set up binary cache / cachix (maximal) (push) Waiting to run
Set up binary cache / cachix (nix) (push) Waiting to run
Treewide Checks / Validate flake (push) Waiting to run
Treewide Checks / Check formatting (push) Waiting to run
Treewide Checks / Check source tree for typos (push) Waiting to run
Treewide Checks / Validate documentation builds (push) Waiting to run
Treewide Checks / Validate documentation builds-1 (push) Waiting to run
Treewide Checks / Validate documentation builds-2 (push) Waiting to run
Treewide Checks / Validate documentation builds-3 (push) Waiting to run
Treewide Checks / Validate hyperlinks in documentation sources (push) Waiting to run
Treewide Checks / Validate Editorconfig conformance (push) Waiting to run
Build and deploy documentation / Check latest commit (push) Waiting to run
Build and deploy documentation / publish (push) Blocked by required conditions
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ic8fad27899388fae9651833aa2ec80d96a6a6964
105 lines
3.1 KiB
Nix
105 lines
3.1 KiB
Nix
{
|
|
config,
|
|
pkgs,
|
|
lib,
|
|
...
|
|
}: let
|
|
inherit (lib.options) mkOption mkEnableOption literalExpression;
|
|
inherit (lib.types) nullOr enum package either int;
|
|
inherit (lib.modules) mkRenamedOptionModule;
|
|
inherit (lib.nvim.types) mkPluginSetupOption luaInline;
|
|
inherit (lib.generators) mkLuaInline;
|
|
inherit (config.vim.lib) mkMappingOption;
|
|
in {
|
|
imports = [
|
|
(mkRenamedOptionModule ["vim" "terminal" "toggleterm" "direction"] ["vim" "terminal" "toggleterm" "setupOpts" "direction"])
|
|
(mkRenamedOptionModule ["vim" "terminal" "toggleterm" "enable_winbar"] ["vim" "terminal" "toggleterm" "setupOpts" "enable_winbar"])
|
|
];
|
|
|
|
options.vim.terminal.toggleterm = {
|
|
enable = mkEnableOption "toggleterm as a replacement to built-in terminal command";
|
|
mappings = {
|
|
open = mkMappingOption "Open toggleterm" "<c-t>";
|
|
};
|
|
|
|
setupOpts = mkPluginSetupOption "ToggleTerm" {
|
|
direction = mkOption {
|
|
type = enum ["horizontal" "vertical" "tab" "float"];
|
|
default = "horizontal";
|
|
description = "Direction of the terminal";
|
|
};
|
|
|
|
enable_winbar = mkEnableOption "winbar";
|
|
|
|
size = mkOption {
|
|
type = either luaInline int;
|
|
default = mkLuaInline ''
|
|
function(term)
|
|
if term.direction == "horizontal" then
|
|
return 15
|
|
elseif term.direction == "vertical" then
|
|
return vim.o.columns * 0.4
|
|
end
|
|
end
|
|
'';
|
|
defaultText = literalExpression ''
|
|
mkLuaInline '''
|
|
function(term)
|
|
if term.direction == "horizontal" then
|
|
return 15
|
|
elseif term.direction == "vertical" then
|
|
return vim.o.columns * 0.4
|
|
end
|
|
end
|
|
'''
|
|
'';
|
|
description = "Integer or Lua function which is passed to the current terminal";
|
|
};
|
|
|
|
winbar = {
|
|
enabled = mkEnableOption "winbar in terminal" // {default = true;};
|
|
name_formatter = mkOption {
|
|
type = luaInline;
|
|
default = mkLuaInline ''
|
|
function(term)
|
|
return term.name
|
|
end
|
|
'';
|
|
defaultText = literalExpression ''
|
|
mkLuaInline '''
|
|
function(term)
|
|
return term.name
|
|
end
|
|
'''
|
|
'';
|
|
description = "Winbar formatter function.";
|
|
};
|
|
};
|
|
};
|
|
|
|
lazygit = {
|
|
enable = mkEnableOption "LazyGit integration";
|
|
direction = mkOption {
|
|
type = enum ["horizontal" "vertical" "tab" "float"];
|
|
default = "float";
|
|
description = "Direction of the lazygit window";
|
|
};
|
|
|
|
package = mkOption {
|
|
type = nullOr package;
|
|
default = pkgs.lazygit;
|
|
defaultText = literalExpression "pkgs.lazygit";
|
|
description = ''
|
|
The package that should be used for lazygit.
|
|
|
|
Setting this option to `null` will instead attempt to use `lazygit`
|
|
from your {env}`PATH`
|
|
'';
|
|
};
|
|
|
|
mappings = {
|
|
open = mkMappingOption "Open lazygit [toggleterm]" "<leader>gg";
|
|
};
|
|
};
|
|
};
|
|
}
|