You are not logged in.
Pages: 1
Topic closed
Hi, I did some searching around and can't quite seem to come up with the answer I'm looking for.
When I perform a "sudo vi" to edit protected configuration files, it does not load the tricked out .vimrc I already have configured. I believe Arch is using the real vi (not vim) and therefore requires a .exrc config file to load in customizations.
My question is, if I'm correct in my assumptions, where should I place the configuration file for use with sudo vi? Putting it in my $HOME doesn't seem to do the trick.
Offline
isn't it because it loads /root/.vimrc ?
Ah, good taste! What a dreadful thing! Taste is the enemy of creativeness.
Picasso
Perfection is reached, not when there is no longer anything to add, but when there is no longer anything to take away.
Saint Exupéry
Offline
Find plugin for vim that can use sudo with
$ vim sudo:/path/to/fileAnd it still load your ~/.vimrc
Ask, and it shall be given you.
Seek, and ye shall find.
Knock, and it shall be opened unto you.
Offline
Install vim and alias vi='vim'
Offline
isn't it because it loads /root/.vimrc ?
Just tried out your suggestion, and it doesn't seem to load my tweaks from either .vimrc or .exrc.
Install vim and alias vi='vim'
I've read that using vim to edit some files isn't a good practice? Also, I do have this setup but using "sudo vi" will not load vim (at least not with my customizations).
Offline
I've read that using vim to edit some files isn't a good practice? Also, I do have this setup but using "sudo vi" will not load vim (at least not with my customizations).
I believe that this is refering to files that have seperate commands specifically to edit them ie. visudo, crontab. There shouldn't be an issue using sudo vim to edit files, at least I have never come across one.
Offline
I think ChoK is right, it looks at /root/.vimrc
Just copy your ~/.vimrc to /root/.vimrc and you should be good to go.
Or else try making a symbolic link and then when you edit your vimrc the changes will be there for root too.
Or just use a global vimrc maybe.
Last edited by dioltas (2010-11-01 14:05:19)
Offline
I had this problem as well a while back. It seems that sudo changed its default behavior a while back. It used to leave the $HOME environment variable unchanged, but now it changes it to root's home for security reasons. If you want to revert back to the old behavior, open the sudoers file and add the line:
Defaults env_keep += "HOME"Now vim (and any other program) will load your config files instead of root's.
Offline
To install for a single user just save it in their home dir at /home/username/.vimrc
All you need to do is create a home folder for root and symlink your vimrc
Offline
Have you noticed the date on top of the last post?
2010-11-01 16:21:59
1+ year was for the OP probably enough to figure it out...
:: Registered Linux User No. 223384
:: github
:: infinality-bundle+fonts: good looking fonts made easy
Offline
Thank you kertz but as bohoomil points out, this thread is too old: https://wiki.archlinux.org/index.php/Fo … Bumping.22.
Closing.
aur S & M :: forum rules :: Community Ethos
Resources for Women, POC, LGBT*, and allies
Offline
Pages: 1
Topic closed