7

So in my bash/zsh terminals I have the set -o vi. But then I need to press ESC to get into command mode. I can't figure out how I could make that command mode the default behavior?

3
  • 1
    Command mode seems more useful on a non-empty command line; why do you want to make it the default?
    – chepner
    Feb 19, 2013 at 18:06
  • pressing 'i' is easier than reaching out to 'ESC' (especially on my Kinessis keyboard)...
    – revit09
    Feb 19, 2013 at 18:13
  • You can change the key used to enter command mode to something other than Escape. I mention this because the documentation for bind-key in man zshzle mention not being able to link vicmd to main, as you would not be able to switch from viins to vicmd (presumably after switching to viins the first time).
    – chepner
    Feb 19, 2013 at 18:20

1 Answer 1

3

You can achieve that behaviour with 'xdotool'. Install it and add this to your ~/.bashrc then

set -o vi
xdotool key Escape
1
  • yes, it should only be executed, when the $DISPLAY variable is set. maybe there is a more universal way to emulate the input.
    – ineb
    Feb 24, 2013 at 10:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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