/etc/vim/vimrc contains a block of code that effectively disallows remapping 'g' in a user's .vimrc file. Reproducible: Always Steps to Reproduce: 1. Add this line to ~/.vimrc ":map g o" 2. Open an existing file with vim Actual Results: The second line of the opened file will have these two characters added: "' Expected Results: The file should not have been modified immediately after being opened. I assume the following gentoo-specific code in /etc/vim/vimrc is the culprit: " When editing a file, always jump to the last cursor position autocmd BufReadPost * \ if line("'\"") > 0 && line ("'\"") <= line("$") | \ exe "normal g'\"" | \ endif
Feel free to modify your /etc/vim/vimrc or disable that autocmd if you want to use really weird maps.
What about something that achieves gentoo's goals and also it's user's goals? What about using this instead? au BufReadPost * if line("'\"") | exe "'\"" | endif
No, because then the user could come up with some other equally weird mapping which would break that.