I may have accidentally changed some setting but now I can't figure out what it is.
Behavior:
- Whenever I edit an existing file, Vim starts in replace (
R
) mode. This is new as of this week. - Whenever I do
vim nonExistantFile.txt
, Vim starts in normal mode
Steps so far to diagnose:
/etc/vimrc
has nothing relevant, and specifically does not containstartreplace
/home/<myuser>/.vimrc
has nothing relevant, and specifically does not containstartreplace
alias
shows nothingvim
related
Platform info:
- Vim version 7.3.1314
- Windows 7 64-Bit
- 32 Bit Cygwin and Vim binary
Other potentially relevant information:
- Some time ago (before this started happening) I copied
/etc/vimrc
from my CentOS 6.4 machine into the Cygwin/etc/vimrc
- I edited some binary files recently
I'm pretty stumped, I can't think of anything else to try.
Update:
- I have narrowed the problem down to this
/etc/vimrc
snippet - Oddly commenting out EITHER of these two commands solves the problem
Vimrc snippet (note: this does have unix line endings):
" Only do this part when compiled with support for autocommands
if has("autocmd")
"<snip>
" When editing a file, always jump to the last cursor position
autocmd BufReadPost *
\ if line("'\"") > 0 && line ("'\"") <= line("$") |
\ exe "normal! g'\"" |
\ endif
" don't write swapfile on most commonly used directories for NFS mounts or USB sticks
autocmd BufNewFile,BufReadPre /media/*,/mnt/* set directory=~/tmp,/var/tmp,/tmp
"<snip>
endif
.viminfo
file. I had a similar problem once and it solved it. My theory is that.viminfo
contained some rogue command which was executed at startup. – EyalArunix2dos
on the file and it choked – durron597