tmux-plugins / tmux-sensible

basic tmux settings everyone can agree on
MIT License
1.78k stars 92 forks source link

Not forcing emacs bindings if vi has been set #19

Closed codeinabox closed 9 years ago

codeinabox commented 9 years ago

Can we change it so it doesn't force emacs bindings if vi has been set in the .vimrc? Assuming it's just a case of wrapping it in option_value_not_changed I'm happy to submit a PR.

bruno- commented 9 years ago

Hey, are you talking about C-p and C-n key bindings? We already have "guards" for these - link to code.

codeinabox commented 9 years ago

I was referring to the setting for status-keys

bruno- commented 9 years ago

Ah - that option. Are you really using vi mode for that? I'm all about vim, but tmux command line vi mode is horrible. And look, even tpope has it explicitly set to emacs.

codeinabox commented 9 years ago

Fair play though is it tricky to wrap it in a option_value_not_changed? Otherwise happy for this issue to be closed

bruno- commented 9 years ago

Just revisiting this again.. I think it would be tricky to detect if a user explicitly set this option in his tmux.conf.

Here's from $ man tmux, status-keys option:

The default is emacs, unless the VISUAL or EDITOR
environment variables are set and contain the string `vi'.

So if a user has EDITOR set to vi or vim, this option will automatically be set to vi (which is not the default, but the user also didn't set it explicitly).

I don't see an (easy) way to check this so I'm closing the issue. Feel free to reopen if you have some ideas.

dragonxlwang commented 8 years ago

sorry to bring this old thread again. I am new to the status-keys settings until across this plugin. Could you please tell me what's the difference in vi/emacs option in status-keys (not in copy mode)? I tried to find related info and tried by myself but I don't see any notable differences.