6

I have the following vim packages installed on Linux Mint Debian Edition:

vim
vim-common
vim-tiny
vim-runtime
vim-doc

I had the above packages installed before, and after installing Vundle (it was functional via instructions on http://github.com/gmarik/vundle) decided, to avoid plugin conflicts, to completely remove and reinstall all of the above vim packages/.vim folder, in order to fully utilize Vundle as a means to manage my plugins. In my file explorer, I can see that the folder created from git cloning ~/.vim and all inherited folders/files belong to root. This causes the following problems with Vundle:

First of all when I executed :BundleSearch query:

http://imgur.com/ZB2RnR7

To further diagnose my problem, I tried adding a bundle manually into my vimrc:

Bundle 'scrooloose/nerdtree'

Using the exact same vimrc setup in the Vundle GitHub, it worked on the previous installation. Now when I attempt to :BundleInstall I get the following permission-based errors:

[140112 13:48:10] 

[140112 13:48:10] Bundle scrooloose/nerdtree

[140112 13:48:10] $ git clone --recursive 'https://github.com/scrooloose/nerdtree.git' '/home/ahqiao/.vim/bundle/nerdtree'

[140112 13:48:10] > fatal: could not create work tree dir '/home/ahqiao/.vim/bundle/nerdtree'.: Permission denied\00

[140112 13:48:11] 

[140112 13:48:11] Helptags:

[140112 13:48:11] :helptags /home/ahqiao/.vim/bundle/vundle/doc/

[140112 13:48:11] > Error running :helptags /home/ahqiao/.vim/bundle/vundle/doc/

[140112 13:48:11] Helptags: 1 bundles processed

Furthermore, my vimrc also contains the standard two lines for plugins:

filetype plugin on

set nocp

In the past, I have also had problems with :helptags not being able to access ~/.vim/doc because of permission so I have had to manually copy the help files into a non-root folder and point to that with :helptags.

How can I overcome these root problems? Vundle is really essential for me to manage the amount of plugins I require to code and keep track of.

johnsyweb
  • 136,902
  • 23
  • 188
  • 247
Rice
  • 3,371
  • 4
  • 19
  • 23
  • How are you cloning `vundle` and where are you putting it? Actually, how did you create `~/.vim` directory? Can you show us the permissions on it? – bnjmn Jan 12 '14 at 21:21
  • git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle And as stated before the clone worked on previous install. For some reason VIM is not happy about permissions of my /.vim directory – Rice Jan 12 '14 at 21:23
  • If `~/.vim` and all subdirs belong to root, why don't you `chown` to yourself? It seems that is how it should be in `HOME`, but it's unclear to me how it got that way in the first place. Are you saying that when you cloned Vundle this happened? – bnjmn Jan 12 '14 at 21:27
  • after i uninstalled vim the first time, I deleted the entire /.vim directory, when I reinstalled the packages /.vim was not created (I am not sure if VIM does this automatically?) and thus the directory was created as a result of the git clone command (which I ran with normal permission terminal). Also note that my reinstall processes were done in synaptic with the "complete removal" options checked – Rice Jan 12 '14 at 21:32
  • In general, things in your `HOME` directory should belong to your `USER`. You may have run `sudo git clone ...` when installing Vundle before or something else with `sudo` that created the directory but I don't think Vim would ever do that automatically. – bnjmn Jan 12 '14 at 22:00

5 Answers5

14

It's unclear to me how the owner of ~/.vim got set to root but Vundle will definitely have trouble updating packages if that is the case.

If I understand correctly, in that you now have Vim installed how you want it, I suggest redoing the customization process.


Move ~/.vim (for reference) and create the bundle directory where Vundle will be installed:

$ sudo mv ~/.vim ~/OLDvim
$ mkdir -p ~/.vim/bundle

This should now be an empty dir owned by your user.

Reinstall Vundle

$ git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim

Make sure you have the required lines in your ~/.vimrc,

  • open vim and
  • run :BundleInstall

Once you got it working and you're happy with everything, you can rm -rf ~/OLDvim.

bnjmn
  • 4,508
  • 4
  • 37
  • 52
  • Recursing through with chown (as in the above comment) appeared to fix my problems. Thanks bnjmn, would upvote you if I could. I'm pretty new here, so I really appreiciate your assistance – Rice Jan 12 '14 at 21:51
  • This worked for me. Upvoted. Thanks for providing this solution! – Saurabh Hirani May 05 '14 at 03:12
  • This approach worked for me, but [vundle install instructions](https://github.com/gmarik/Vundle.vim#quick-start) are slightly different now. – ncherro May 07 '14 at 14:21
5

Changing the ownership of the .vim files to my username instead of root worked for me (did for all files recursively):

chown -R <username>:<username> .vim

Here's more info about chown.

Note: It seems like the reinstall answer would work too (though didn't end up trying it), but with the chown approach you don't have to do the reinstall steps.

Blue Raspberry
  • 811
  • 7
  • 6
1

It's very late to answer, but this problem still occuring. I run into this problem and Here is how I solved it. First run the ( get the error while installing the Plugin)

    :helptags /home/ahqiao/.vim/bundle/vundle/doc/

It will show the Exact Error. In my Case it was Duplicate Entries found in two ale doc file ale-cpp.txt and ale-cpp.txt.

    Error: Duplicate Entries Found g:ale_cpp_flawfinder_executable
    Error: Duplicate Entries Found g:ale_c_flawfinder_executable

Just remove these entries or comment out and Install agin. Now it works fine.

Sajjan Kumar
  • 353
  • 1
  • 3
  • 16
0

Also very late to answer, but in my case, changing the line:

call vundle#begin('$USERPROFILE/.vim/bundle') 

to

call vundle#begin('$HOME/.vim/bundle') 

corrected the problem. Apparently, $USERPROFILE was not defined, and so evaluated to root (/).

This may help someone....

NotCharlie
  • 43
  • 2
  • 9
0

Uninstalling/Installing the offending plugin (vim-fugitive) fixed the error for me.

I was getting this error:

> Error running :helptags /Users/gigo6000/.vim/bundle/vim-fugitive/doc 

So I deleted the line:

Plugin 'tpope/vim-fugitive'

Run

:so %
:PluginClean
:PluginInstall

And that did the work.

Carlos Mafla
  • 489
  • 1
  • 6
  • 12