
파일에 sudo vim을 사용하면 다음과 같이 실패합니다.
$ sudo vim test
Error detected while processing /home/dcampbe1/.vimrc:
line 12:
E117: Unknown function: vundle#begin
line 13:
E492: Not an editor command: Plugin 'VundleVim/vundle.vim'
line 14:
E492: Not an editor command: Plugin 'bundle/vim-colors-solarized'
line 15:
E492: Not an editor command: Plugin 'tpope/vim-fugitive'
line 16:
E492: Not an editor command: Plugin 'w0ng/vim-hybrid'
line 17:
E492: Not an editor command: Plugin 'airblade/vim-gitgutter'
line 18:
E492: Not an editor command: Plugin 'vim-airline/vim-airline'
line 19:
E492: Not an editor command: Plugin 'vim-airline/vim-airline-themes'
line 20:
E492: Not an editor command: Plugin 'jreybert/vimagit'
line 21:
E492: Not an editor command: Plugin 'valloric/youcompleteme'
line 22:
E492: Not an editor command: Plugin 'scrooloose/nerdtree'
line 23:
E117: Unknown function: vundle#end
line 26:
E185: Cannot find color scheme 'hybrid'
line 149:
E471: Argument required
Press ENTER or type command to continue
그러나 동일한 파일에서 vim을 실행하면 올바른 vundle 구성으로 올바르게 열립니다. 내 사용자가 아닌 루트가 소유한 파일이 많기 때문에 sudo vim을 자주 사용해야 합니다. sudo vim을 실행할 때 사용되는 일반 루트 구성에는 문제가 없지만 sudo vim이 내 vundle 구성에 들어가려고 시도하고 어떻게든 실패한다는 사실에 놀랐습니다.
무슨 일이 일어나고 있는지 아는 사람이 있나요? sudo vim을 실행하면 일반 루트 vim으로 이동하거나 .vimrc에서 내가 구성한 vim으로 이동하는 수정 사항이 작동합니다.