Tag Archives: terminal

Fix home, end, pageup, pagedown keys in mac terminal vim

If you use vim in the mac terminal follow the steps below to regain use of these vital keys.

  1. Open Terminal.
  2. Open Preferences.
  3. Select Settings.
  4. Select your desired theme.
  5. Select Keyboard.
  6. Double click each key in title above.
  7. For each key set Action to ‘send string to shell:’ and set string as below.
    • Home: 33[7~
    • End: 33[4~
    • Page Up: 33[5~
    • Page Down: 33[6~

These will alter the key bindings not only in vim but in the terminal in general. If you want vim specific bindings another option is to use vim specific shortcuts. Personally, I prefer to use the above bindings and then in bash use ctrl-a for home and ctrl-e for end.

Did this tip help you? Let me know in the comments! [Credit]