{ helpers, ... }: { keymaps = [ # Window movement. { mode = [ "n" ]; key = ""; action = "h"; options = { remap = true; }; } { mode = [ "n" ]; key = ""; action = helpers.mkRaw '' function() local cur_win = vim.api.nvim_get_current_win() vim.cmd('wincmd h') if cur_win == vim.api.nvim_get_current_win() then require('neo-tree.command').execute({ toggle = true }) end end ''; options = { remap = true; }; } { mode = [ "n" ]; key = ""; action = helpers.mkRaw '' function() local cur_win = vim.api.nvim_get_current_win() vim.cmd('wincmd j') if cur_win == vim.api.nvim_get_current_win() then vim.cmd('ToggleTerm') end end ''; options = { remap = true; }; } { mode = [ "n" ]; key = ""; action = "k"; options = { remap = true; }; } { mode = [ "n" ]; key = ""; action = "l"; options = { remap = true; }; } # Use ESC to exit terminal mode { mode = [ "t" ]; key = ""; action = ""; } # Buffer movement { mode = [ "n" ]; key = ""; action = "bprevious"; options = { desc = "Previous Buffer"; }; } { mode = [ "n" ]; key = ""; action = "bnext"; options = { desc = "Next Buffer"; }; } { mode = [ "n" "i" ]; key = ""; action = "tabprevious"; options = { desc = "Previous Tab"; }; } ]; }