Vim is exhibiting some configuration behaviors that confuse me.
I have read that vim accepts
$VIM/vimrc
as its default configuration file. In my shell environment,$VIM
is set to/etc/vim
, but/etc/vim/vimrc
is not used as the default config file. Rather,/usr/share/vim/vimrc
is used.I have defined the following mapping in my vimrc file (which is now
/usr/share/vim/vimrc
),nnoremap ccom :normal I//< ESC>< CR>
. This map is supposed to insert a c-style comment at the beginning of the current line. When I use this map, I get the text//<ESC><CR>
put at the beginning of the current line. This is a malfunction. Similarly, if I start vim with-u /usr/share/vim/vimrc
, the mapping exhibits the same undesirable behavior. If, however, I use the ex commandsource /usr/share/vim/vimrc
, the mapping simply inserts//
at the beginning of the line. How can this be?Why isn't showcmd set if
:show cmd
is in a configuration file that I know ran?