I have an alias defined
alias svi='sudo /usr/bin/vim -i /home/jeff/.viminfo -u /home/jeff/.vimrc'
but when I type svi myfile
I get
Error detected while processing /home/jeff/.vimrc:
line 1:
E117: Unknown function: pathogen#infect
It seems I need to force vim to scan my .vim directory before executing call pathogen#infect()
How do I do that, and in general, how can I make sure that when I run sudo vim
I get the same environment that I would have by just running vim
?
sudo vim
is to be able to edit root-owned files, you may look at Tim Pope's vim-eunuch plugin. It has aSudoWrite
command which will allow you to overwrite a priviliged file from Vim started without privileges.