Monday, September 21, 2009

OS X VIM Terminal PageUp, PageDown, Home, End and Forward/Backward Word WORKING

One really big issue with the mac laptops is that some keys are missing.
Home, End, PageUp and PageDown are obtained as combination of Fn+Arrows.
And the forward/backward-word are not mapped by default they are Ctrl-Right/Left in linux.

Sometimes these keys are not properly reflected inside vim.

To correct this issue I found several pages, one of them is
http://blog.sbw.be/2008/12/11/mac-osx-vim-terminal-page-up-page-down-home-end-working/

Just go to:
Terminal > File > Preferences
and change the following keyboard settings.

OSX VIM TERMINAL PAGE UP, PAGE DOWN, HOME, END WORKING
Home: \033[1~
End: \033[4~
PageUp: \033[6~
PageDown: \033[5~

TERMINAL backward/forward-word
"\033[5D": backward-word
"\033[5C": forward-word

UPDATE: TERMINAL backward/forward-word ALSO WORKING WITH VIM
Change both: .inputrc and the terminal preferences to match these codes.
"\033[1;5C": forward-word
"\033[1;5D": backward-word

No comments:

Post a Comment