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

Vim -> Vim does not work in nix package vim_configurable #264

Open
bobismijnnaam opened this issue Jun 5, 2020 · 3 comments · May be fixed by #368
Open

Vim -> Vim does not work in nix package vim_configurable #264

bobismijnnaam opened this issue Jun 5, 2020 · 3 comments · May be fixed by #368

Comments

@bobismijnnaam
Copy link

bobismijnnaam commented Jun 5, 2020

I cannot switch between vim panes when using the vim_configurable package in nix. I think this is because the process name is different/unknown to vim-tmux-navigator. I used the command from #195 to check this

ps -o state= -o comm= -t $(tmux display-message -t 1 -p '#{pane_tty}')

This prints in my case:

S bash
S .vim-wrapped

As a sanity check, the :TmuxNavigateDown and others work fine. It's just that <C-j> and others move to the next tmux pane instead of vim pane. As another sanity check, I installed the regular vim package from nix, and that one does work.

I tried to resolve this by adding . and -wrapped to the is_vim command in my .tmux.conf, but I couldn't get it to work. I would be fine with having to modify the command to fit my kind of vim, but currently I am not sure what I have to add/modify to make it work. For reference, this is what I tried changing the is_vim to:

is_vim="ps -o state= -o comm= -t '#{pane_tty}' \
    | grep -iqE '^[^TXZ ]+ +(\\S+\\/)?g?(view|\.?n?vim?x?(-wrapped)?)(diff)?$'"

What do I have to change is_vim to to make it work with vim_configurable?

@christoomey
Copy link
Owner

Hmm, I'm not sure what exactly you would need to change the pattern to. You're very much in the right ballpark as the process name does not seem to be matching. I'd suggest continuing to tweak there, but you could also try the original process matching check (less functionality, but easier to work with, I think).

@bobismijnnaam
Copy link
Author

bobismijnnaam commented Jun 5, 2020

I fiddled a bit, and turns out that the pattern I wanted to use works. The problem is that if I change the is_vim pattern in .tmux.conf, it is not updated in my terminals?

$ tmux display-message -p '#{is_vim}'
ps -o state= -o comm= -t '#{pane_tty}'     | grep -iqE '^[^TXZ ]+ +(\S+\/)?g?(view|n?vim?x?)(diff)?$'

I am quite sure that my .tmux.conf contains the right value for is_vim (i.e. the original grep, but with -wrapped added). What could be the cause of this?

EDIT: Added my tmux.conf (with mangled name to make github accept it)

bak.tmux.conf.txt

@bobismijnnaam
Copy link
Author

Well, turns out the is_vim var was updated after one or more reboots, since it suddenly started working. So the adjustment I initially tried does indeed work. The issue is now resolved as far as I'm concerned.

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

Successfully merging a pull request may close this issue.

2 participants