vim-tmux-navigator(needs some work on bindings)

This commit is contained in:
Andrei Stoica 2024-01-25 02:25:12 -05:00
parent 5c88830f93
commit e91d840f90
3 changed files with 39 additions and 0 deletions

View File

@ -17,6 +17,13 @@ M.general = {
["n"] = {"nzz", "find next"},
["N"] = {"Nzz", "find prev"},
-- navigation
["<c-h>"] = {"<cmd> TmuxNavigateLeft<cr>", "window left" },
["<c-j>"] = {"<cmd> TmuxNavigateDown<cr>", "window down" },
["<c-k>"] = {"<cmd> TmuxNavigateUp<cr>", "window up" },
["<c-l>"] = {"<cmd> TmuxNavigateRight<cr>", "window right" },
["<c-\\>"] = {"<cmd> TmuxNavigatePrevious<cr>", "window previous" },
},
}

View File

@ -4,6 +4,17 @@ local overrides = require "custom.configs.overrides"
---@type NvPluginSpec[]
local plugins = {
{
"christoomey/vim-tmux-navigator",
cmd = {
"TmuxNavigateLeft",
"TmuxNavigateDown",
"TmuxNavigateUp",
"TmuxNavigateRight",
"TmuxNavigatePrevious",
},
lazy = false,
},
-- Override plugin definition options
{

View File

@ -1,3 +1,9 @@
# plugins
set -g @plugin 'alexghergh/nvim-tmux-navigation'
run '~/.tmux/plugins/tpm/tpm'
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
@ -28,3 +34,18 @@ bind h attach-session -t . -c "#{pane_current_path}"
# status bar
set -g status-right '%H:%m %d-%b-%y '
# Start windows and panes at 1, not 0
set -g base-index 1
set -g pane-base-index 1
set-window-option -g pane-base-index 1
set-option -g renumber-windows on
# navigation
bind-key 'j' select-pane -D
bind-key 'k' select-pane -U
bind-key 'l' select-pane -R
bind-key 'h' select-pane -L
bind -n S-Left previous-window
bind -n S-Right next-window