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

39 lines
870 B
Nix
Raw Normal View History

2024-03-24 17:39:49 -05:00
{
config,
lib,
2024-03-24 17:39:49 -05: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 12:31:00 -05: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 17:39:49 -05:00
};
};
}