diff --git a/modules/terminal/toggleterm/config.nix b/modules/terminal/toggleterm/config.nix index 9e98bb1..c4934dc 100644 --- a/modules/terminal/toggleterm/config.nix +++ b/modules/terminal/toggleterm/config.nix @@ -14,7 +14,7 @@ in { vim.luaConfigRC.toggleterm = nvim.dag.entryAnywhere '' require("toggleterm").setup({ - open_mapping = [[]], + open_mapping = '${cfg.mappings.open}', direction = '${toString cfg.direction}', -- TODO: this should probably be turned into a module that uses the lua function if and only if the user has not set it size = function(term) diff --git a/modules/terminal/toggleterm/toggleterm.nix b/modules/terminal/toggleterm/toggleterm.nix index e2ed940..8c60ea8 100644 --- a/modules/terminal/toggleterm/toggleterm.nix +++ b/modules/terminal/toggleterm/toggleterm.nix @@ -7,6 +7,13 @@ with lib; with builtins; { options.vim.terminal.toggleterm = { enable = mkEnableOption "Enable toggleterm as a replacement to built-in terminal command"; + mappings = { + open = mkOption { + type = types.str; + description = "The keymapping to open toggleterm"; + default = ""; + }; + }; direction = mkOption { type = types.enum ["horizontal" "vertical" "tab" "float"]; default = "horizontal";