vim.keymap.set("t", "", "") --- Exit terminal mode -- Only set these keymaps for toggleterm vim.api.nvim_create_autocmd("TermOpen", { pattern = "term://*toggleterm#*", callback = function() -- vim.keymap.set("t", "", "") --- Exit terminal mode vim.keymap.set("t", "", "h") vim.keymap.set("t", "", "j") vim.keymap.set("t", "", "k") vim.keymap.set("t", "", "l") end, }) -- These are all the different types of terminals we can trigger local terminal = require("toggleterm.terminal").Terminal local basicterminal = terminal:new() function TERM_TOGGLE() basicterminal:toggle() end local nixpkgs = terminal:new({ cmd = "nix repl --expr 'import {}'" }) function NIXPKGS_TOGGLE() nixpkgs:toggle() end vim.keymap.set("n", "t", TERM_TOGGLE) vim.keymap.set("n", "P", NIXPKGS_TOGGLE)