Include vim-tmux-navigator to support hotkey switching between nvim and tmux panes

This commit is contained in:
Daniel McKnight 2025-05-16 17:52:32 -07:00
parent 8c71f6e703
commit 74a36ba246
4 changed files with 28 additions and 2 deletions

View file

@ -6,7 +6,7 @@ set -g prefix C-space
bind-key C-space send-prefix bind-key C-space send-prefix
# Shortcut to custom hints # Shortcut to custom hints
bind-key -n C-h run-shell "tmux popup -xC -yC -w50% -h75% 'cat ~/.tmux/hints'" bind h run-shell "tmux popup -xC -yC -w50% -h75% 'cat ~/.tmux/hints'"
# Shortcut to sync panes # Shortcut to sync panes
bind C-x setw synchronize-panes bind C-x setw synchronize-panes
@ -77,5 +77,13 @@ set -g @resurrect-processes 'ssh nano k9s'
set -g @plugin 'tmux-plugins/tmux-open' set -g @plugin 'tmux-plugins/tmux-open'
set -g @open-S 'https://search.brave.com/search?q=' set -g @open-S 'https://search.brave.com/search?q='
# Integrate with nvim navigation
set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @vim_navigator_mapping_left "C-Left C-h"
set -g @vim_navigator_mapping_right "C-Right C-l"
set -g @vim_navigator_mapping_up "C-Up C-k"
set -g @vim_navigator_mapping_down "C-Down C-j"
# Load Plugins # Load Plugins
run '~/.tmux/plugins/tpm/tpm' run '~/.tmux/plugins/tpm/tpm'

@ -0,0 +1 @@
Subproject commit 33afa80db65113561dc53fa732b7f5e53d5ecfd0

View file

@ -4,6 +4,12 @@ vim.cmd("set tabstop=2")
vim.cmd("set softtabstop=2") vim.cmd("set softtabstop=2")
vim.cmd("set shiftwidth=2") vim.cmd("set shiftwidth=2")
-- Configure Navigation Keys
--vim.keymap.set('n', '<c-Left>', ':wincmd h<CR>')
--vim.keymap.set('n', '<c-Right>', ':wincmd l<CR>')
--vim.keymap.set('n', '<c-Up>', ':wincmd k<CR>')
--vim.keymap.set('n', '<c-Down>', ':wincmd j<CR>')
-- Configure Editor Settings -- Configure Editor Settings
vim.cmd("set number") vim.cmd("set number")
vim.opt.guifont = "JetBrainsMonoNerdFontMono:14" vim.opt.guifont = "JetBrainsMonoNerdFontMono:14"
@ -16,10 +22,14 @@ require("config.lazy")
-- Configure Telescope Keymaps -- Configure Telescope Keymaps
local builtin = require("telescope.builtin") local builtin = require("telescope.builtin")
vim.keymap.set('n', '<C-p>', builtin.find_files, {}) vim.keymap.set('n', '<C-p>', builtin.find_files, {})
vim.keymap.set('n', '<leader>g', builtin.live_grep, {}) vim.keymap.set('n', '<leader>gg', builtin.live_grep, {})
-- Init Treesitter Syntax Highlighting -- Init Treesitter Syntax Highlighting
--require("config.treesitter") --require("config.treesitter")
-- Configure NeoTree (FS View) -- Configure NeoTree (FS View)
vim.keymap.set('n', '<leader>f', ':Neotree filesystem reveal left<CR>') vim.keymap.set('n', '<leader>f', ':Neotree filesystem reveal left<CR>')
-- Configure Git
vim.keymap.set('n', '<leader>gd', ':Gitsigns preview_hunk<CR>', {})
vim.keymap.set('n', '<leader>gb', ':Gitsigns toggle_current_line_blame<CR>', {})

View file

@ -0,0 +1,7 @@
return {
"christoomey/vim-tmux-navigator",
vim.keymap.set('n', '<c-Left>', ':TmuxNavigateLeft<CR>'),
vim.keymap.set('n', '<c-Right>', ':TmuxNavigateRight<CR>'),
vim.keymap.set('n', '<c-Up>', ':TmuxNavigateUp<CR>'),
vim.keymap.set('n', '<c-Down>', ':TmuxNavigateDown<CR>'),
}