nix-config/modules/home-manager/nvim/toggleterm.nix

39 lines
870 B
Nix
Raw Normal View History

2024-03-24 23:39:49 +01:00
{
config,
lib,
2024-03-24 23:39:49 +01:00
pkgs,
...
}: {
config = lib.mkIf config.user.nvim.enable {
programs.nixvim = {helpers, ...}: {
plugins.toggleterm = {
enable = true;
settings = {
direction = "horizontal";
insert_mappings = false;
terminal_mappings = false;
open_mapping = ''[[<c-\>]]'';
};
2024-04-22 19:31:00 +02:00
};
keymaps = [
{
action = helpers.mkRaw "function() Floatingterm:toggle() end";
key = "<leader>s";
mode = "n";
options = {
silent = true;
desc = "toggle scratch terminal";
};
}
];
extraConfigLuaPre = ''
local Terminal = require('toggleterm.terminal').Terminal
Floatingterm = Terminal:new({
hidden = true,
direction = "float"
})
'';
2024-03-24 23:39:49 +01:00
};
};
}