Open lazylance3 opened 6 months ago
I opened vim outside a tmux session and the keybindings <C-h>.. (etc)
now work in vim split panes. I'm assuming this is an issue in my .tmux.conf
?
I am seeing same issue.
Linux Mint 21 nvim 0.10.0
I had a similar issue and found this change to .tmux.conf to be helpful:
--- is_vim="ps -o state= -o comm= -t '#{pane_tty}' \ --- | grep -iqE '^[^TXZ ]+ +(\S+\/)?g?(view|l?n?vim?x?|fzf)(diff)?$'"
+++ is_vim="ps -o args -g $$ | grep -iqE 'n?vim?x?'"
I don't know all the ins and outs of ps, but it seems to work for me.
On the other hand,
I am experiencing the same issue. Pane switching in Neovim works fine when I'm not in a tmux session. However, if I map <Ctrl+hjkl>
to another command, such as echom 'Hello'
, nothing happens. It seems that tmux is intercepting the <Ctrl+hjkl>
keybindings. @rgeddes's approach seems to be on the right track, but it still doesn't work for me.
I encountered the same issue. After installing the Fig plugin, the ttys sequence in my terminal got messed up, causing the #{pane_tty} parameter to be passed incorrectly.
Here is the output of the ps command:
15775 ttys004 0:00.37 zsh (figterm)
15786 ttys005 0:00.33 /bin/zsh --login
15821 ttys005 0:00.01 /bin/zsh --login
15861 ttys005 0:00.00 /bin/zsh --login
15862 ttys005 0:00.00 /bin/zsh --login
15864 ttys005 0:00.01 /Users/chh/.cache/gitstatus/gitstatusd-darwin-arm64 -G v1.5.4 -s -1
15866 ttys005 0:00.09 nvim
The value of #{pane_tty} is ttys004, but nvim is running on ttys005, causing vim's detection to fail.
Solution: Check if the output of #{pane_tty} matches the ttys where nvim is running. If not, it could be due to the influence of terminal plugins. My temporary solution is to uninstall Fig.
@HzTTT Suggestion worked. Fig is now changed to Amazon Q for command line. Uninstalling the latter solved the problem. Thank you. 🙏
@htlin222 How do you use Amazon Q for command line?😭I seem to still be having issues with it. Here is my ps output:
PID TTY TIME CMD
79402 ttys000 0:00.15 zsh (qterm)
79411 ttys002 0:00.08 /bin/zsh --login
79475 ttys002 0:00.00 /bin/zsh --login
79476 ttys002 0:00.02 q _ inline-shell-completion --buffer ps
The first ttys000 zsh (qterm)
is mistakenly recognized by #{pane_tty}
, but nvim should be on ttys002
.
Possibly unrelated, but I run neovim inside alpine and ran into the same issue described above. Not sure if this was a recent change or not but I needed to install procps
for things to work properly. Definitely check that ps command.
@neurosnap I'm using mac.procps
doesn't seem to support mac.
I am using nvim inside an alpine docker container and I have the same issue. What I have observed is that this started happening recently so I guess it was caused by a recent change?
I had the same issue and found a solution.
Opening split paned in Vim and a terminal buffer -> no issues moving in and out. Doing the same but from within Tmux -> I couldn't move into the terminal buffer.
This update changed the mappings from noremap
to nnoremap
.
https://github.com/christoomey/vim-tmux-navigator/commit/c600cf10db1bf933aab9e357158bf9b202ecf99b
Reverting the changes by adding the following config to my vimrc fixed my issue:
let g:tmux_navigator_no_mappings = 0
noremap <silent> <C-h> :<C-U>TmuxNavigateLeft<cr>
noremap <silent> <C-j> :<C-U>TmuxNavigateDown<cr>
noremap <silent> <C-k> :<C-U>TmuxNavigateUp<cr>
noremap <silent> <C-l> :<C-U>TmuxNavigateRight<cr>
noremap <silent> <C-\> :<C-U>TmuxNavigatePrevious<cr>
Any update on this issue? Facing the same problem where vim pane navigation works great outside of tmux, tmux <-> vim navigation works great in tmux but cannot change vim panes inside tmux. Tried both above fixes but to no avail. Thanks for your help!
Had the same problem, uninstalling Amazon Q (prior Fig) fixes the issue. But if you want both Amazon Q and vim-tmux-navigator to work you have to modify the is_vim
expression of the plugin. Check out the Fig's Known Issues page https://github.com/withfig/fig/blob/main/KNOWN-ISSUES.md#vim-tmux-navigator and this comment here https://github.com/christoomey/vim-tmux-navigator/issues/295#issuecomment-1021591011
Possibly unrelated, but I run neovim inside alpine and ran into the same issue described above. Not sure if this was a recent change or not but I needed to install
procps
for things to work properly. Definitely check that ps command.
That was the issue here, thanks @dbagia.
PS: I am running a Fedora 40 rootfs inside of WSL2 - that does not happen on Fedora 40 Workstation.
Had the same problem, uninstalling Amazon Q (prior Fig) fixes the issue. But if you want both Amazon Q and vim-tmux-navigator to work you have to modify the
is_vim
expression of the plugin. Check out the Fig's Known Issues page https://github.com/withfig/fig/blob/main/KNOWN-ISSUES.md#vim-tmux-navigator and this comment here #295 (comment)
That works. thank you!
I'm running
Ubuntu 22.04.4 LTS
viaWSL2 on Windows 11
Output for
:verbose nmap <C-h>
Output for
:TmuxNavigatorProcessList
tmux.conf
I'm using
lazy.nvim
as my nvim plugin manager and this is the only thing I have inplugins/init.lua