nix-community.nixvim/plugins/utils/floaterm.nix
Alexander Nortung 3f9effc575
general: add package options (#127)
* barbar: package option

* Base16: package option

* gruvbox: package option

* nord: package option

* one: package option

* onedark: package option

* tokyonight: package option

* nvim-cmp: package option

* coq: package option

* lspkind: package option

* helpers: added package option to mkPlugin

* fugitive: package option

* gitgutter: package option

* gitsigns: package option

* neogit: package option

* ledger: package option

* nix: package option

* plantuml-syntax: package option

* treesitter-context: package option + formatting

* treesitter-refactor: package option + formatting

* treesitter: package option

* zig: package option

* null-ls: package option

* null-ls/servers: package option

* lsp-lines: package option

* lspsaga: package option

* trouble: package option

* luasnip: added description for package option

* airline: package option

* lightline: package option

* lualine: package option

* telescope: package option

* telescope/frecency: package option

* telescope/fzf-native: package option

* telescope/media-files: package option

* comment-nvim: package option

* vim-commentary: package option

* dashboard: package option

* easyescape: package option

* emmet: package option

* endwise: package option

* floaterm: package option

* goyo: package option

* intellitab: package option

* mark-radar: package option

* notify: package option

* nvim-autopairs: package option

* nvim-tree: package option

* project-nvim: package option

* specs: package option

* startify: package option

* surround: package option

* undotree: package option
2023-01-19 10:45:15 +00:00

91 lines
3.2 KiB
Nix

{ config, pkgs, lib, ... }:
with lib;
let
cfg = config.plugins.floaterm;
helpers = import ../helpers.nix { inherit lib; };
in
{
options = {
plugins.floaterm = {
enable = mkEnableOption "Enable floaterm";
package = mkOption {
type = types.package;
default = pkgs.vimPlugins.vim-floaterm;
description = "Plugin to use for floatterm";
};
shell = mkOption {
type = types.nullOr types.str;
default = null;
};
title = mkOption {
type = types.nullOr types.str;
description = "Show floaterm info at the top left corner of the floaterm window.";
default = null;
};
winType = mkOption {
type = types.nullOr (types.enum [ "float" "split" "vsplit" ]);
default = null;
};
winWidth = mkOption {
type = types.nullOr types.float;
description = "number of columns relative to &columns.";
default = null;
};
winHeight = mkOption {
type = types.nullOr types.float;
description = "number of lines relative to &lines.";
default = null;
};
borderChars = mkOption {
type = types.nullOr types.str;
description = "8 characters of the floating window border (top, right, bottom, left, topleft, topright, botright, botleft)";
default = null;
};
rootMarkers = mkOption {
type = types.nullOr (types.listOf types.str);
description = "Markers used to detect the project root directory for --cwd=<root>";
default = null;
};
opener = mkOption {
type = types.nullOr (types.enum [ "edit" "split" "vsplit" "tabe" "drop" ]);
description = "Command used for opening a file in the outside nvim from within :terminal";
default = null;
};
autoClose = mkOption {
type = types.nullOr (types.enum [ 0 1 2 ]);
description = "Whether to close floaterm window once the job gets finished.";
default = null;
};
autoHide = mkOption {
type = types.nullOr (types.enum [ 0 1 2 ]);
description = "Whether to hide previous floaterm before switching to or opening another one.";
default = null;
};
autoInsert = mkOption {
type = types.nullOr types.bool;
description = "Whether to enter Terminal-mode after opening a floaterm.";
default = null;
};
};
};
config = mkIf cfg.enable {
extraPlugins = [
cfg.package
];
globals = {
floaterm_shell = mkIf (!isNull cfg.shell) cfg.shell;
floaterm_title = mkIf (!isNull cfg.title) cfg.title;
floaterm_wintype = mkIf (!isNull cfg.winType) cfg.winType;
floaterm_width = mkIf (!isNull cfg.winWidth) cfg.winWidth;
floaterm_height = mkIf (!isNull cfg.winHeight) cfg.winHeight;
floaterm_borderchars = mkIf (!isNull cfg.borderChars) cfg.borderChars;
floaterm_rootmarkers = mkIf (!isNull cfg.rootMarkers) cfg.rootMarkers;
floaterm_opener = mkIf (!isNull cfg.opener) cfg.opener;
floaterm_autoclose = mkIf (!isNull cfg.autoClose) cfg.autoClose;
floaterm_autohide = mkIf (!isNull cfg.autoHide) cfg.autoHide;
floaterm_autoInsert = mkIf (!isNull cfg.autoInsert) cfg.autoInsert;
};
};
}