Tmux on Mac, how can I enable vi mode for the command line

bashvi

I want to be able to hit escape and then use vi navigation keys like b (back a word). I can do this in my regular terminal sessions by setting set -o vi in my .bashrc file.

However it's not working in tmux. I added set -o vi in my .tmux_conf file, but it only works for 1 "hit" then I get switched back into insert mode after hitting the key. So if I press [escape] i can go back one word with [b] but then the next [b] just inserts the b character.

How can I make that 'vi' mode work in my tmux sessions the same way it does at my 'plain' bash shell.

Best Answer

Add set -o vi to the ~/.bash_profile file