I'm using iTerm2 on Mac OSX 10.8 with an xterm
key binding and zsh
.
I'd like zsh
to use option left arrow and option right arrow to do the standard Mac bindings of left and right word.
If I hit ctrl-v then option-left and right arrows, where are the two key sequences that print:
^[[1;9D
^[[1;9C
I tried using binding these sequences using bindkey -v
, but with no luck.
You can configure iTerm2 to do this like so:
iTerm2 > Preferences > Profiles > Keys
⌥ ←
or ⌥ →
setting, delete it by selecting it and hitting -
.+
button.Send Escape Sequence
in the Action box.b
for Characters to send.Ok
.Repeat the above procedure for ⌥ →
, this time entering f
for the Characters to send.
Taken from this great tutorial which describes the whole process in detail and with pictures:
Use ⌥ ← and ⌥ → to jump forwards / backwards words in iTerm 2, on OS X | Coderwall
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With