Fresh Vim install, Vim permission errors, Vundle not functional - vim

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:
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.

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.

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.

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.

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....

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.

Related

Vim: When using Vundle how can I also include a plugin that I am writing?

Where should I put my own code when developing a plugin while at the same time using Vundle? I tried to use a local repo but I have to commit in order for vim to see the changes I am making… What is the right way of doing this?
Once Vundle has retrieved the plugin's source, you can just remove the directory of your bundle in the vim plugins directory and make a symbolic link to your git workspace.
rm -rf ~/.vim/bundle/yourplugin/
ln -s /path/to/the/plugin/youre/developing/plugin ~/.vim/bundle/yourplugin
It's more hackish than #demure's answer, but it works.
According to this ticket, use the following:
Bundle '~/path/your-plugin/.git'
Where ~/path/your-plugin is the working copy.

Installing Snipmate with Pathogen vim

I attempted to install Snipmate in vim via Pathogen, by:
cd ~/Dropbox/vim/bundle
git clone https://github.com/garbas/vim-snipmate
cd vim-snipmate
git clone https://github.com/honza/vim-snippets.git
(My vim repository is in Dropbox, with my ~/.vimrc reading:
set runtimepath+=~/Dropbox/vim
source ~/Dropbox/vim/vimrc.vim
)
However nothing happens when I press tab. I'm not sure what I'm doing wrong here? Based on other blogs/questions, I have already tried moving the snippets directory to ~/.vim/ and other locations, but to no avail. I also have "filetype plugin on". So I'm pretty stumped. Am I being stupid here?
Thanks!
SnipMate makes use of the after directory to define its mappings (to ensure that no other plugin overrides them). Therefore, you need to add that directory hierarchy to 'runtimepath', too:
set runtimepath+=~/Dropbox/vim,~/Dropbox/vim/after

Installing fuzzyfinder vim plugin

I unziped the vim-fuzzyfinder and vim-l9 packages in my ~/.vimrc directory
[shetye#dev03 ~/.vim/vim-fuzzyfinder]$ls
autoload doc plugin
[shetye#dev03 ~/.vim]$cd vim-l9/
[shetye#dev03 ~/.vim/vim-l9]$ls
autoload doc plugin
Also i tried copying the same in my home directory. vim however does not detect this plugin.
:fuf-usage
E492: Not an editor command fuf-usage
:FufBuffer
E492: Not an editor command FufBuffer
I tried adding the directory ~/.vim/vim-fuzzyfinder, ~/.vim/vim-l9 to the $PATH env variable. That did not help either.
Any ideas on how to get fuzzyfinder going ?
You should install it correctly to make it work. This is the file structure you should have:
~/
+-.vim/
+-autoload/
+-doc/
+-plugin/
Once you get to that point, you are supposed to type this command in Vim:
:helptags ~/.vim/doc
The .vim directory structure that you have created is a mix between traditional Vim (where all plugins are mixed together into single .vim/autoload/, .vim/plugin/, etc. directories) and the separation (into .vim/bundle/<pluginname>/autoload/) created by package managers like Pathogen or Vundle.
Either stick to the original layout (even though there are many proponents for the new package structure, the old one works just fine; it's just not as easy to uninstall a plugin), or install one of the mentioned package managers and adhere to their prescribed layout.

VIM installation on OS X 10.8 Mountain Lion can't be found on ~/.vim/

I'm pretty new on OS X and VIM, and I just tried to install MacVim (I downloaded snapshot 66 from github, which is actually build 7.3.754).
The problem is that when I was trying to install Sparkup (https://github.com/rstacruz/sparkup), I found that the installation folder is not on ~/.vim/
I tried this on Terminal:
ls ~/.vim/
but it always returned ls: /Users/andreoentoro/.vim: No such file or directory
Any insights on what I do wrong here? I'm not really used to terminal though I am pretty good at working on DOS command, but it's totally different.
Many thanks in advance.
This folder, its subfolders (like plugin, doc, etc.) and your ~/.vimrc are not created by Vim. You must create them yourself:
$ cd
$ mkdir .vim
$ touch .vimrc
Here is what you should get if you follow the plugin's instructions:
/Users/andreoentoro/.vim
|-after
|---plugin
|-----snipMate.vim
|-autoload
|---snipMate.vim
|-doc
|---snipMate.txt
|-ftplugin
|---html_snip_helper.vim
|-plugin
|---snipMate.vim
|-snippets
|---(many files)
|-syntax
|---snippet.vim
Just copying ftplugin won't be enough.

How to install Vim plugins in Fedora 16

I installed Vim in Fedora 16 with this command:
$ yum -y install vim-enhanced
Vim works just fine, but now I wanted to add the NERD Commenter and NERD Tree plugins. In the home directory I cant find neither .vim/ nor .vimrc. So I went ahead and created those but still it's not picking it up.
How do you install Vim plugins in Fedora?
You have to create ~/.vimrc and ~/.vim/ yourself.
After that simply follow each plugin's installation instructions.
For NERDTree (from the plugin's page):
Unzip the archive into your ~/.vim directory.
That should put NERD_tree.vim in ~/.vim/plugin and NERD_tree.txt in ~/.vim/doc.
Run :helptags.
Go :help NERD_tree.txt for the help page.
After all that, you are supposed to end up with this structure:
~/.vim/doc/NERD_tree.txt
~/.vim/doc/tags
~/.vim/nerdtree_plugin/exec_menuitem.vim
~/.vim/nerdtree_plugin/fs_menu.vim
~/.vim/plugin/NERD_tree.vim
~/.vim/syntax/nerdtree.vim
Which is all you need to use NERDTree:
:NERDTree<CR>
Did you try the "built-in" netrw, invoked with :Ex (:Hex,:Sex,:Vex…), before deciding to install NERDTree?
The fact that your distribution is Fedora should be largely irrelevant. The install process is the same for any GNU/Linux distribution.
I recommend you manage your plugins with Tim Pope's Pathogen. Install Pathogen to your .vim directory per the instructions in the README. Then, edit your .vimrc to run Pathogen on startup (again, see the README).
Then, with Pathogen installed, you can add any plugin to the directory .vim/bundle, and it'll load automatically.
Vim's plugin management is pretty crummy, and Pathogen fills the much-needed role of a plugin manager. It's wildly popular, and pretty simple.

Resources