Wednesday, 14 August 2013

How to force emacs-style status-keys in tmux?

How to force emacs-style status-keys in tmux?

I have this problem with tmux 1.8: I want to set status-keys option to
'emacs' because I really dislike entering commands in vi-mode. However
adding the following line to .tmux.conf has no effect:
set -g status-keys emacs
When tmux is restarted, tmux show-options -g | grep keys says emacs but
the actual behaviour is vi-style.
The root of the problem is the $EDITOR environment variable, which it set
to vim in my case. The documentations states:
status-keys [vi | emacs]
Use vi or emacs-style key bindings in the status line,
for example at the command prompt. The default is emacs,
unless the VISUAL or EDITOR environment variables are set
and contain the string `vi'.
So apparently when the environment variable is "vim" it forces vi
status-keys.
Is there a way to override this behaviour and have the prompt behave
emacs-style despite the environment variable? I can obviously hack around
this (like starting tmux with other env variables and restoring the
original later) but I hope there is a clean solution.
Thanks!

No comments:

Post a Comment