Skip to content
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

Problems when using vim-tmux-navigator with fig (https://fig.io) #339

Closed
juliangoetze opened this issue Jan 14, 2023 · 8 comments
Closed

Comments

@juliangoetze
Copy link

Vim-Tmux Problems when using fig

As mentioned here, there are problems when using vim-tmux-navigator together with fig.

My observations:

  • Switching panels inside tmux itself works great (even if there is nvim running in one of that panes)
  • Trying to switch windows inside nvim (with keybindings) only triggers switching the tmux panes
  • Manually calling :TmuxNavigateRight(/Left/Up/Down) in nvim command mode works as expected (for nvim windows, tmux panes, and between those, see gif below)
  • Therefore the main problem (as far as I interpreted this right): Tmux captures the keybindings when they are pressed inside nvim, but fails to send them back to nvim

capture

Possible problem sources:

#.zshrc
# Fig pre block. Keep at the top of this file.
[[ -f "$HOME/.fig/shell/zshrc.pre.zsh" ]] $$ builtin source "$HOME/.fig/shell/zshrc.pre.zsh"

# My zsh configs
# ...

# Fig post block. Keep at the bottom of this file.
[[ -f "$HOME/.fig/shell/zshrc.post.zsh" ]] $$ builtin source "$HOME/.fig/shell/zshrc.post.zsh"
# ~/.fig/shell/zshrc.pre.zsh
# (sourced in the .zshrc)
[ -x ~/.local/bin/fig ] && eval "$(~/.local/bin/fig init zsh pre --rcfile zshrc)"
# ~/.fig/shell/zshrc.post.zsh
# (sourced in the .zshrc)
[ -x ~/.local/bin/fig ] && eval "$(~/.local/bin/fig init zsh post --rcfile zshrc)"

The setup:

  • tmux -V --> tmux 3.3a
  • nvim -version --> NVIM v0.8.1
  • :TmuxNavigatorProcessList (inside nvim) --> Ss+ zsh (figterm)
  • sw_vers --> macOS 12.6

If anyone has a solution in mind, please tell me about it :)
If not, I'll just say goodbye to fig, that's fine to me...

And if more information is needed, just hit me up and I'll paste it here.

conradbeach added a commit to conradbeach/dotfiles that referenced this issue Jan 20, 2023
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
conradbeach added a commit to conradbeach/dotfiles that referenced this issue Jan 20, 2023
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
@vhristev
Copy link

vhristev commented Feb 3, 2023

After uninstalling Fig everything started to work again.

brew uninstall fig

@juliangoetze
Copy link
Author

After uninstalling Fig everything started to work again.

brew uninstall fig

@vhristev Yes, that solved the problem for me too. The question is, if there is any solution/ workaround to have fig and the tmux-navigator working at the same time, without having to dispense with one of both..

@JakeTompkins
Copy link

I'm having the same problem. I'd like to keep using fig so a solution to this would be awesome. Let me know if I can provide any other diagnostics to help troubleshoot

@nguyenanhhao221
Copy link

I'm having the same issue. Removing fig work fine.

But does anybody know a similar solution to fig. I'm not that familiar with all the terminal command so fig tool can really help with it cause they also include a explanation

@unitythemaker
Copy link

I have the same problem but I don't have Fig installed. I use NixOS if that makes any change but I am so annoyed by how it works perfect on everyone else and doesn't work on my pc...

@unitythemaker
Copy link

unitythemaker commented Apr 27, 2023

I have the same problem but I don't have Fig installed. I use NixOS if that makes any change but I am so annoyed by how it works perfect on everyone else and doesn't work on my pc...

Seems like the issue was that I am using Fish. When I set my default shell to bash, it worked even if the default shell set in the tmux was fish. When I did it with fish I was getting no output from :TmuxNavigatorProcessList when I switched to bash I got the output:

S fish
S nvim

Btw it also did not work when I tried to spawn an instance of bash in fish.

Perhaps, I should open an issue for this? For me, I will use tmux as default (by making bash execute tmux) so it is not a problem for me but could be a problem for others and maybe it should be noted on readme.

@hoolek77
Copy link

hoolek77 commented May 2, 2023

If you still encounter this issue, this solution helped me to fix integration with Fig #295 (comment)

@juliangoetze
Copy link
Author

As @hoolek77 mentioned, the solution of #295 fixes this issue (mostly). After creating the is_vim.sh as suggested, and replacing the is_vim line in the tmux plugin, the horizontal pane switching does work, although vertical window switching in vim itself does still not work as expected.
I will close this issue as fixed with the workaround of #295 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants