You are not logged in.
Pages: 1
Hello all,
Ive got some problems with vim, and i cant figure it out how to solve it.
I always used the standard vim config but i wanted to get some new colors, plugins etc.
so i installed pathegon but it didnt worked.
tried vundle and this didnt worked either.
so i looked up if my .vimrc is getting loaded correctly, since for both vim bundle managers you need a working vimrc
i wrote a simple setting in it, set ruler, which should always show me the current position.
And as i thought, it didnt changed anything.
I tried vim -V to see what happens, this is the output:
>_LC_ALL=C vim -V
chdir(/etc)
fchdir() to previous dir
sourcing "/etc/vimrc"
Searching for "archlinux.vim" in "/root/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/root/.vim/after"
Searching for "/root/.vim/archlinux.vim"
Searching for "/usr/share/vim/vimfiles/archlinux.vim"
chdir(/usr/share/vim/vimfiles)
fchdir() to previous dir
line 11: sourcing "/usr/share/vim/vimfiles/archlinux.vim"
finished sourcing /usr/share/vim/vimfiles/archlinux.vim
continuing in /etc/vimrc
Searching for "/usr/share/vim/vim74/archlinux.vim"
Searching for "/usr/share/vim/vimfiles/after/archlinux.vim"
Searching for "/root/.vim/after/archlinux.vim"
finished sourcing /etc/vimrc
chdir(/root)
fchdir() to previous dir
could not source "$HOME/.vimrc"
chdir(/root/.vim)
fchdir() to previous dir
could not source "~/.vim/vimrc"
chdir(/root)
fchdir() to previous dir
could not source "$HOME/.exrc"
Searching for "plugin/**/*.vim" in "/root/.vim,/usr/share/vim/vimfiles,/usr/share/vim/vim74,/usr/share/vim/vimfiles/after,/root/.vim/after"
Searching for "/root/.vim/plugin/**/*.vim"
Searching for "/usr/share/vim/vimfiles/plugin/**/*.vim"
Searching for "/usr/share/vim/vim74/plugin/**/*.vim"
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/getscriptPlugin.vim"
finished sourcing /usr/share/vim/vim74/plugin/getscriptPlugin.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/gzip.vim"
finished sourcing /usr/share/vim/vim74/plugin/gzip.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/logiPat.vim"
finished sourcing /usr/share/vim/vim74/plugin/logiPat.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/matchparen.vim"
finished sourcing /usr/share/vim/vim74/plugin/matchparen.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/netrwPlugin.vim"
finished sourcing /usr/share/vim/vim74/plugin/netrwPlugin.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/rrhelper.vim"
finished sourcing /usr/share/vim/vim74/plugin/rrhelper.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/spellfile.vim"
finished sourcing /usr/share/vim/vim74/plugin/spellfile.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/tarPlugin.vim"
finished sourcing /usr/share/vim/vim74/plugin/tarPlugin.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/tohtml.vim"
finished sourcing /usr/share/vim/vim74/plugin/tohtml.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/vimballPlugin.vim"
finished sourcing /usr/share/vim/vim74/plugin/vimballPlugin.vim
chdir(/usr/share/vim/vim74/plugin)
fchdir() to previous dir
sourcing "/usr/share/vim/vim74/plugin/zipPlugin.vim"
finished sourcing /usr/share/vim/vim74/plugin/zipPlugin.vim
Searching for "/usr/share/vim/vimfiles/after/plugin/**/*.vim"
Searching for "/root/.vim/after/plugin/**/*.vim"
Reading viminfo file "/root/.viminfo" info oldfiles
Press ENTER or type command to continueAs you see it wont source it, also its in my home directory.
Here is the output of :scriptnames inside vim
1: /etc/vimrc
2: /usr/share/vim/vimfiles/archlinux.vim
3: /usr/share/vim/vim74/plugin/getscriptPlugin.vim
4: /usr/share/vim/vim74/plugin/gzip.vim
5: /usr/share/vim/vim74/plugin/logiPat.vim
6: /usr/share/vim/vim74/plugin/matchparen.vim
7: /usr/share/vim/vim74/plugin/netrwPlugin.vim
8: /usr/share/vim/vim74/plugin/rrhelper.vim
9: /usr/share/vim/vim74/plugin/spellfile.vim
10: /usr/share/vim/vim74/plugin/tarPlugin.vim
11: /usr/share/vim/vim74/plugin/tohtml.vim
12: /usr/share/vim/vim74/plugin/vimballPlugin.vim
13: /usr/share/vim/vim74/plugin/zipPlugin.vimany help here? i dont know what to do.
I already wiped vim from my computer and installed it back again to start fresh, but it still wont work.
I hope i gave all the relevant information.
Greetings, max
Offline
could not source "$HOME/.vimrc" chdir(/root/.vim) fchdir() to previous dir could not source "~/.vim/vimrc" chdir(/root)
Why is it trying to read files in "/root"? Are you running it as root? Does the file "/root/.vimrc" exist? Is that what you mean to do?
Last edited by drcouzelis (2016-01-13 15:43:58)
Offline
If you're not running as root, something is definitely wrong. Otherwise I have no idea.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
Oh dang, i hadnt thought about that!!
It really was the problem that i ran it with sudo.
Had it in my bash_alias file. Looks like this wasnt a good idea.
I didnt understood the output of vim -V correctly so i never could have figured that out^^
Really thanks for the quick help.
Offline
As it was told you run vim with sudo. By default it removes your current $HOME from environment list. Thus vim tries to use root home folder and does not find any config there.
You can use your current HOME if you run vim with
sudo HOME=~ vim foo.c
Or edit sudoers file and uncomment line
defaults env_keep += "HOME"
Update: Another way to preserver current user environment when using sudo is to pass '-E' flag to sudo. But I am not fully sure how secure such practice.
Last edited by anatolik (2016-01-14 19:39:46)
Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster
Offline
Added this information to Arch wiki https://wiki.archlinux.org/index.php/Vi … _with_sudo
Read it before posting http://www.catb.org/esr/faqs/smart-questions.html
Ruby gems repository done right https://bbs.archlinux.org/viewtopic.php?id=182729
Fast initramfs generator with security in mind https://wiki.archlinux.org/index.php/Booster
Offline
IMO a better option is to use sudoedit; the editor is run as normal user. In the case of vim, your own configs will be sourced, modelines will function, etc. The only downside I know of is that you won't be able to edit any other root-owned files in that instance.
But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner
Offline
Offline
Use the vim plugin "vim-eunuch", available in the AUR.
:SudoWriteAlso comes with a command for
:SudoEdit /some/file/without/read/permissionsManaging AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
or to make it rather elegant:
command W :execute ':silent w !sudo tee % > /dev/null' | :edit!
I love this. This is why Vim is simultaneously the best and worst text editor ever made. ![]()
Offline
Pages: 1