From 9365a7753e5b32de6af5b34a3dcb6f8fcccd5dc1 Mon Sep 17 00:00:00 2001 From: n3oney Date: Wed, 5 Apr 2023 00:06:30 +0200 Subject: [PATCH] feat: toggleterm keybindings --- modules/terminal/toggleterm/config.nix | 2 +- modules/terminal/toggleterm/toggleterm.nix | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) 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";