refactor: use new mapping format

This commit is contained in:
n3oney 2023-04-11 14:38:27 +02:00
commit 7e566c9687
No known key found for this signature in database
GPG key ID: C786693DE727850E
4 changed files with 56 additions and 17 deletions

View file

@ -14,7 +14,7 @@ in {
vim.luaConfigRC.toggleterm = nvim.dag.entryAnywhere ''
require("toggleterm").setup({
open_mapping = '${cfg.mappings.open}',
open_mapping = null,
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)
@ -32,5 +32,7 @@ in {
},
})
'';
vim.maps.normal = mkBinding cfg.mappings.open "<Cmd>execute v:count . \"ToggleTerm\"<CR>" "Toggle terminal";
};
}

View file

@ -9,7 +9,7 @@ with builtins; {
enable = mkEnableOption "Enable toggleterm as a replacement to built-in terminal command";
mappings = {
open = mkOption {
type = types.str;
type = types.nullOr types.str;
description = "The keymapping to open toggleterm";
default = "<c-t>";
};