Arrow keys spontaneously stop working in vim

vim

I recently upgraded from OS X 10.6 (I think) to 10.9. Since then it seems, while editing in vim, the arrow keys will "spontaneously" stop working.

At one point, in frustration I "mashed" one of the arrow keys and was eventually shown a "E388 Couldn't find a definition" error. All other times I've experienced it, the arrows, having worked for awhile, suddenly start dinging at me!

Quitting and reopening solves the problem temporarily. But, I'd like to prevent it!

Anyone know what this might be? And how to fix it?


It looks like my default vimrc was modified during the update. If my memory is correct, it was a pretty big file previously. Now, it just contains this:

" Configuration file for vim
set modelines=0         " CVE-2007-2438

" Normally we use vim-extensions. If you want true vi-compatibility
" remove change the following statements
set nocompatible        " Use Vim defaults instead of 100% vi compatibility
set backspace=2         " more powerful backspacing

" Don't write backup file if vim is being called by "crontab -e"
au BufWrite /private/tmp/crontab.* set nowritebackup
" Don't write backup file if vim is being called by "chpass"
au BufWrite /private/etc/pw.* set nowritebackup

I have no idea what these options do yet. I'll look into it — but, hopefully someone here knows more quickly than I can google and read …

Best Answer

Found in James Hodgkinson's blog, the following command works for me. Note it will refresh the vim screen.

:!reset
Related Question