Closed hwypengsir closed 7 years ago
What OS did you use?
sudo command impersonate user. On some OS or distribution, sudo command does not pass some environment variables.
debian8
Then please try
$ sudo vim
and :scriptnames
Maybe some plugins should not be loaded.
sudo vim :scriptnames 1: /usr/share/vim/vimrc 2: /usr/share/vim/vim74/debian.vim 3: /usr/share/vim/vim74/plugin/getscriptPlugin.vim 4: /usr/share/vim/vim74/plugin/gzip.vim 5: /usr/share/vim/vim74/plugin/matchparen.vim 6: /usr/share/vim/vim74/plugin/netrwPlugin.vim 7: /usr/share/vim/vim74/plugin/rrhelper.vim 8: /usr/share/vim/vim74/plugin/spellfile.vim 9: /usr/share/vim/vim74/plugin/tarPlugin.vim 10: /usr/share/vim/vim74/plugin/tohtml.vim 11: /usr/share/vim/vim74/plugin/vimballPlugin.vim 12: /usr/share/vim/vim74/plugin/zipPlugin.vim
vim
:scriptnames
~
1: /usr/share/vim/vimrc
2: /usr/share/vim/vim74/debian.vim
3: ~/.vimrc
4: /usr/share/vim/vim74/filetype.vim
5: /usr/share/vim/vim74/ftplugin.vim
6: /usr/share/vim/vim74/indent.vim
7: ~/.vim/plugin/emmet.vim
8: /usr/share/vim/vim74/plugin/getscriptPlugin.vim
9: /usr/share/vim/vim74/plugin/gzip.vim
10: /usr/share/vim/vim74/plugin/matchparen.vim
11: /usr/share/vim/vim74/plugin/netrwPlugin.vim
12: /usr/share/vim/vim74/plugin/rrhelper.vim
13: /usr/share/vim/vim74/plugin/spellfile.vim
14: /usr/share/vim/vim74/plugin/tarPlugin.vim
15: /usr/share/vim/vim74/plugin/tohtml.vim
16: /usr/share/vim/vim74/plugin/vimballPlugin.vim
17: /usr/share/vim/vim74/plugin/zipPlugin.vim
How to fix now?
there are several way to do it. so please read man sudo
.
Here is my vim configuration.
html:5
can be expanded into whole proper format when to edit withvim test.php
, Whyhtml:5
can not be expanded into whole proper format when to edit withsudo vim /var/www/html/test.ph
?