From bd869d4004e12183438cc16bfd1ce7e49cd82f2b Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Sat, 31 Jan 2026 11:46:47 +0000 Subject: Switch to using Alt+hjkl,cursor for navigating tmux panes --- nvim/.config/nvim/lua/config/keymaps.lua | 16 +++++----------- tmux/.config/tmux/tmux.conf | 6 +++++- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/nvim/.config/nvim/lua/config/keymaps.lua b/nvim/.config/nvim/lua/config/keymaps.lua index 70e2633..bb3758f 100644 --- a/nvim/.config/nvim/lua/config/keymaps.lua +++ b/nvim/.config/nvim/lua/config/keymaps.lua @@ -3,12 +3,12 @@ local set = vim.keymap.set -- Move lines up/down -set('n', '', ':m .+1==', { desc = 'Move line down' }) -set('n', '', ':m .-2==', { desc = 'Move line up' }) -set('i', '', ':m .+1==gi', { desc = 'Move line down' }) +set('n', '', ':m .+1==', { desc = 'Move line down' }) +set('n', '', ':m .-2==', { desc = 'Move line up' }) +set('i', '', ':m .+1==gi', { desc = 'Move line down' }) set('i', '', ':m .-2==gi', { desc = 'Move line up' }) -set('v', '', ":m '>+1gv=gv", { desc = 'Move selection down' }) -set('v', '', ":m '<-2gv=gv", { desc = 'Move selection up' }) +set('v', '', ":m '>+1gv=gv", { desc = 'Move selection down' }) +set('v', '', ":m '<-2gv=gv", { desc = 'Move selection up' }) -- Better indenting in visual mode set('v', '<', '', '>gv', { desc = 'Indent right and reselect' }) set('n', 'bn', ':bnext', { desc = 'Next buffer' }) set('n', 'bp', ':bprevious', { desc = 'Previous buffer' }) --- Better window navigation -set('n', '', 'h', { desc = 'Move to left window' }) -set('n', '', 'j', { desc = 'Move to bottom window' }) -set('n', '', 'k', { desc = 'Move to top window' }) -set('n', '', 'l', { desc = 'Move to right window' }) - -- Splitting & Resizing set('n', 'sv', ':vsplit', { desc = 'Split window vertically' }) set('n', 'sh', ':split', { desc = 'Split window horizontally' }) diff --git a/tmux/.config/tmux/tmux.conf b/tmux/.config/tmux/tmux.conf index 58e7e4a..ee47425 100644 --- a/tmux/.config/tmux/tmux.conf +++ b/tmux/.config/tmux/tmux.conf @@ -25,7 +25,11 @@ bind j select-pane -DZ bind k select-pane -UZ bind l select-pane -RZ -# Alt+cursor keys to switch panes without prefix. +# Alt+hjkl,cursor keys to switch panes without prefix. +bind -n M-h select-pane -LZ +bind -n M-j select-pane -DZ +bind -n M-k select-pane -UZ +bind -n M-l select-pane -RZ bind -n M-Left select-pane -LZ bind -n M-Down select-pane -DZ bind -n M-Up select-pane -UZ -- cgit v1.2.3-13-gbd6f