-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Navigating vim splits doesn't work properly. #317
Comments
Same here |
same here. It moves between tmux panes. It also moves from tmux pane to neovim pane and visa versa. But it doesn't move between neovim panes itself. |
Hey folks, could you run through the troubleshooting list, notably the |
Hmm, are you perhaps on a very old version of the vim plugin? |
I doubt it since i installed it recently. How can I check its version? |
Definitely odd then. Can you try running Alternatively you could track down where your vim plugins are installed and look at the contents of the file itself to see if it matches what's on github right now. |
|
@christoomey i am using Neovim v0.8.0. Does the plugin support neovim? |
The plugin is definitely intended to support Neovim. I'm surprised to see that it's not working. Can you track down the installed version of the plugin on your machine and confirm if it matches the version on Github? Specifically this line is the one that defines the command in question. |
Yup, I can definitely see what you're reporting. Unfortunately not much more for me to go from in the gif. Can you track down the installed version of the plugin code on your machine and confirm if it matches the version on Github? Specifically this line is the one that defines the command in question. |
Exact same issue here.
|
Probably same issue a #295 ? Copy-Paste fix that works for me:
ps: this works, but seems to have some impact on performance |
I had the same issue but in my case, it was caused by https://fig.io/. I uninstalled it and now it's working as expected. |
I fixed the issue using this tip Added lines in
|
didn't work for me. Interested to see how it works for others. |
Are you running a poetry shell by any chance? I see the same problem (navigating inside Neovim doesn't work, but does between Neovim and tmux) but only if I've run FWIW, the output of
and without poetry shell running:
|
I can confirm I used it for a while without any problem. As soon as I run
Anything I can workaround this? Found the same error mentioned in #230 (comment). The workaround seems to much for me though, but also didn't work. I'm using Python with |
In my case, it looks like I've got
Setting $SHELL to either just |
@johnoshea Wow, that is a big one; thanks for that, I never noticed this! It did not work for me :( But I added the My workaround, for now, is that I have alternative moving shortcuts for vim that I can use in case I bump into that problem with:
|
I had the same problem with https://fig.io/ and uninstalling fig worked for me too. I guess this issue is worth searching for a solution, because I neither want to dispense with fig nor the vim-tmux-navigation... I will open up an issue on that one |
This reverts commit 7ffe1f2. I'm removing Fig because it caused issues with vim-tmux-runner [1] [2] [3]. The founders of Fig are trying to work with Chris Toomey to find a solution though [3], so I could get it working if I really wanted to I bet. For now, I'm just going to remove Fig; vim and tmux navigation is more important. The thing that attracted me to Fig was the command line autocomplete, but I'm not sure that's worth the cost. Fig does a lot more than I actually want it to, and it seems to be a fairly complex tool. Dealing with it doesn't seem worth the value it would create for me. I'll pass. [1]: christoomey/vim-tmux-navigator#339 [2]: christoomey/vim-tmux-navigator#317 [3]: christoomey/vim-tmux-navigator#295
This reverts commit f306816. I'm removing Fig because it caused issues with vim-tmux-runner [1] [2] [3]. The founders of Fig are trying to work with Chris Toomey to find a solution though [3], so I could get it working if I really wanted to I bet. For now, I'm just going to remove Fig; vim and tmux navigation is more important. The thing that attracted me to Fig was the command line autocomplete, but I'm not sure that's worth the cost. Fig does a lot more than I actually want it to, and it seems to be a fairly complex tool. Dealing with it doesn't seem worth the value it would create for me. I'll pass. [1]: christoomey/vim-tmux-navigator#339 [2]: christoomey/vim-tmux-navigator#317 [3]: christoomey/vim-tmux-navigator#295
I feel like @Zerophase 's issue is different to all the subsequent replies, and it's their issue I'm currently facing. Though after looking into both the vim plugin and the tmux binding implementations, I believe what Zerophase and I both want to happen simply isn't part of tmux-vim-navigator's intended behaviour. When switching from a tmux pane without vim into a tmux pane with vim (i.e. a tmux-vim-pane), if the tmux-vim-pane has multiple vim panes itself, I'd like to switch into the closest of those vim-panes (if this is confusingly described, Zerophase's original comment already gives a simple case example). So far as I understand, it is the intended behaviour that: when switching into a tmux-vim-pane, the vim-pane that will be selected will be whichever one was last active when this tmux-vim-pane was last active. And therefore not necessarily the vim-pane adjacent to the tmux-pane I just left. If this is true, please confirm and perhaps update the readme to reflect this. |
Just reporting that 1/ if I were focused on nvim-tree, then keybinding will take me to tmux. Then again to nvim-tree The above happens if If I do not Curious fact, if executing |
|
I also start to feel like @Zerophase's original issue isn't being addressed here anymore. I'm curious if there is going effort in trying to add the original feature (if possible at all). I also feel like, whether it is possible to or not, that the issue at hand should be addressed somewhere. Possibly in the vim-tmux-navigator README. I would love @christoomey's thoughts on the original issue as well. |
I have the same issue when running vim from poetry |
same here on mac m3 |
I created a keymap to switch between neovim windows, but it doesn't work with tmux-navigator. To fix it, I removed this keymap and added the tip below to ~/.tmux.conf file (thx @popoffvg).
Keymaps I had to remove because they conflicted with tmux-navigator: -- Normal --
-- Better window navigation
keymap("n", "<C-h>", "<C-w>h", opts) -- left window
keymap("n", "<C-k>", "<C-w>k", opts) -- up window
keymap("n", "<C-j>", "<C-w>j", opts) -- down window
keymap("n", "<C-l>", "<C-w>l", opts) -- right window |
Thank you @matheustanaka (caution, there's additional backslash missing above causing tmux to error on start) I've updated # smart pane switching with awareness of vim splits
bind -n C-h run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-h) || tmux select-pane -L"
bind -n C-j run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-j) || tmux select-pane -D"
bind -n C-k run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-k) || tmux select-pane -U"
bind -n C-l run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys C-l) || tmux select-pane -R"
bind -n C-\\ run "(tmux display-message -p '#{pane_current_command}' | grep -iq vim && tmux send-keys 'C-\\') || tmux select-pane -l" |
How to reproduce.
You'll switch to the last active vim split, instead of wrapping around to the split furthest to the right.
The text was updated successfully, but these errors were encountered: