christoomey / vim-tmux-navigator

Seamless navigation between tmux panes and vim splits
MIT License
5.07k stars 319 forks source link

Can't get this working. I'm not able to switch between tmux panes as well as vim splits #378

Closed hrvadl closed 3 months ago

hrvadl commented 3 months ago

Hi!

I followed instructions in the README.md, but it's not working. I've already tried all the troubleshooting instructions. I can't switch between tmux panes using keymaps. Also I can't switch between nvim splits using keymaps. Though, using :TmuxNavigateDown (and other commands inside nvim) works correctly. Could someone help me, please?

Here's my .tmux.conf file

set -g default-terminal "screen-256color"
set-window-option -g mode-keys vi

set -g prefix C-a
unbind C-b
bind-key C-a send-prefix

unbind %
bind | split-window -h 

unbind '"'
bind - split-window -v

unbind r
bind r source-file ~/.tmux.conf

bind -r j resize-pane -D 5
bind -r k resize-pane -U 5
bind -r l resize-pane -R 5
bind -r h resize-pane -L 5

bind -r m resize-pane -Z
set -g mouse on

unbind -T copy-mode-vi MouseDragEnd1Pane 

# remove delay for exiting insert mode with ESC in Neovim
set -sg escape-time 10

# tpm plugin
set -g @plugin 'tmux-plugins/tpm'

set -g @plugin 'christoomey/vim-tmux-navigator'
set -g @plugin "arcticicestudio/nord-tmux"

run '~/.tmux/plugins/tpm/tpm'

And here's lua file with plugin installation

return {
  "christoomey/vim-tmux-navigator",
  cmd = {
    "TmuxNavigateLeft",
    "TmuxNavigateDown",
    "TmuxNavigateUp",
    "TmuxNavigateRight",
    "TmuxNavigatePrevious",
  },
  keys = {
    { "<c-h>",  "<cmd><C-U>TmuxNavigateLeft<cr>" },
    { "<c-j>",  "<cmd><C-U>TmuxNavigateDown<cr>" },
    { "<c-k>",  "<cmd><C-U>TmuxNavigateUp<cr>" },
    { "<c-l>",  "<cmd><C-U>TmuxNavigateRight<cr>" },
    { "<c-\\>", "<cmd><C-U>TmuxNavigatePrevious<cr>" },
  },
}

Operating System: macOS 14.3 Terminal: ITerm2 Tmux version: 3.4 NeoVim version: 0.95

hrvadl commented 3 months ago

I'm sorry, closing this one. The issue was the keymapings overlap. I had yabai WM with (and others) set as system window navigation shortcuts