nix-config/modules/home-manager/nvim/toggleterm.nix
2024-04-22 12:31:00 -05:00

37 lines
745 B
Nix

{
configs,
pkgs,
...
}: {
programs.nixvim = {
plugins.toggleterm = {
enable = true;
settings = {
direction = "horizontal";
insert_mappings = false;
terminal_mappings = false;
open_mapping = ''[[<c-\>]]'';
};
};
keymaps = [
{
action = "function() Floatingterm:toggle() end";
key = "<leader>s";
lua = true;
mode = "n";
options = {
silent = true;
desc = "toggle scratch terminal";
};
}
];
extraConfigLuaPre = ''
local Terminal = require('toggleterm.terminal').Terminal
Floatingterm = Terminal:new({
hidden = true,
direction = "float"
})
'';
};
}