Since upgrading to macOS Sierra my home and end keys no longer work in vim.
They still work properly at the command prompt.
In terminal settings I have home set to send "\001" and end to send "\005".
Since upgrading to macOS Sierra my home and end keys no longer work in vim.
They still work properly at the command prompt.
In terminal settings I have home set to send "\001" and end to send "\005".
I've set my Terminal
keys to \001 for ↖ and \005 for ↘. On my .vimrc:
map <C-A> <Home>
imap <C-A> <Home>
vmap <C-A> <Home>
map <C-E> <End>
imap <C-E> <End>
vmap <C-E> <End>
The accepted answer is not a great option if you need to connect to a lot of remote servers and don't want to keep reconfiguring vim everywhere. I find that it is better to map the Terminal
keys to \033[1~
(Esc followed by [1~
) and \033[4~
(Esc followed by \033[4~
).
There are still some servers that don't like using those codes on the command line -- SUSE Enterprise Linux maps these to readline
's history-search-backward
and set-mark
commands, so you might still have to modify /etc/inputrc
or ~/.inputrc
on those systems, but other Linux distributions don't have that problem.
In case someone end up with this problem using Mac with Ventra, in terminal setting, bind your Home to \033OH and your End key to \033OF.
© 2022 - 2025 — McMap. All rights reserved.