Tuesday, July 11, 2017

OSX: control-left/right moves by words in terminal

I use the three-finger-swipe to move viewports on OSX. Using control-left and -right to move by words in the terminal is VERY helpful!  Here's how to do it:

1) go into Preferences and disable control-left/right

2) add this to your ~/.bashrc file:

# control-left/right = skip by word in terminals
# https://apple.stackexchange.com/a/29037/100272
bind '"\e[5C": forward-word'
bind '"\e[5D": backward-word'
bind '"\e[1;5C": forward-word'

bind '"\e[1;5D": backward-word'

3) log out and back in to enable control-left/right to skip by words

No comments:

Post a Comment