7

In bash commandline, you can use vim shortcuts by setting set editing-mode vi in the ~/.inputrc file. I want to be able do the same when typing <prefix>:new to create a new window for example.

(In my ~/.tmux.conf file, i have set-window-option -g mode-keys vi, which does not achieve the above in the command mode.)

1
  • isn't this just <prefix>:neww as : is bound to the command prompt by default, and neww is an alias for new-window ? – thrig Dec 22 '17 at 23:08
9

You just need to run the following tmux command:

set -g status-keys vi

Then after entering the command line (prefix-key + :) you can, for example, press Esc and move left and right with the H and L keys.

Many other things you are used to with Bash command-line editing are available, too. Esc then K to scroll back through your command history, for instance.

Note: If you're used to hitting Esc to exit the command-line try Ctrl+C instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.