.vimrc configuration file does not load when editing with 'sudo'
问题 I have problem with .vimrc file, the problem is that it sometimes get loaded, and sometimes not. 1 set number 2 syntax on 3 set autoindent 4 map <F2> :!g++ % -Wall -time -O<CR> 5 echo "it works!" I've added echo to check if it's loaded, and when I type e.g. vim .vimrc , it gets loaded and shows me "it works" in terminal, but when I type e.g. sudo vim test.cpp it doesn't get loaded, the message doesn't show up. I'm using debian. 回答1: When you use sudo , Vim gets launched under a different user