Installing Snipmate with Pathogen vim - 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

Related

problems installing vim-misc and vim-session plugins on mac / macvim

When I follow github instructions for vim-misc and vim-sessions, after unzipping to /Users/<me>/.vim/misc and /Users/<me>/.vim/vim-session-master, and then restarting macvim, I get
:helptags ~/.vim/doc
E150: Not a directory: ~/.vim/doc
Also tried putting the two folders in /Users/<me>/ (where my .vimrc is) and in the two locations pointer by $VIM and $VIMRUNTIME from within macvim (/Applications/MacVim.app/Contents/Resources/vim) all to no avail.
I guess I really don't understand how running the :helptags <whatever> starts up/completes installation of these plug-ins anyway?
Before using using a plugin managers, plugins used to go directly into ~/.vim, not into ~/.vim/pluginname. That's when we ran :helptags ~/.vim/doc.
Then we had plugin manager, each with different specific way of doing things. Some even take care of registering the documentation of the plugins installed.
IMO, you'd better find a plugin manager suited to your need and use it. I remember a Q/A on vi.SE, you could start by reading it.
If you prefer to install plugins manually instead of using one of plugin managers like vim-plug or others then you should add plugin directory to your runtimepath. Place this line to your .vimrc set runtimepath+=/path/to/plugin. I would not recommend to place plugins directly to ~/.vim directory, use sub-folder instead (e.g. /Users/<you>/.vim/plugins).

Can't install vim plugins with pathogen

I am connecting to my university's computers. I am trying to customize vim. They put their vim configuration files in the protected /usr/share folder where I have no permissions.
I copied the .vimrc file to my home directory and started changing. This seemed to work :-)
Step 2,
I installed pathogen as instructed here:
http://mirnazim.org/writings/vim-plugins-i-use/
I added the following lines to .vimrc
execute pathogen#infect('~/.vim/bundle/{}')
call pathogen#helptags()
Unfortunately vim doesn't recognize my plugins (for example TagBar). I tried to play with the argument in infect, change execute to call, and etc.
Nothing helped.
Interestingly enough when I do :scriptnames I see that ~/.vim/autoload/pathogen.vim shows. Files in bundle directory don't show though :-(.
Ideas?
I know it is kind of obvious, but your plugins folders actually have files inside?
Some people already missed it: Vim: Pathogen not loading
how can i make my plugin work? maybe without pathogen?
some people like it, other not, but I'd advice you to use Vundle instead of pathogen. Here's a nice post about why, but honestly the main reason is that it's just stupid simple to manage plugins using it.
The installation process is very easy:
git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle
and edit .vimrc :
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
" … new bundles here
filetype plugin indent on
And for each new plugin I want to install, I do add the following to my .vim rc, where the comment is:
Bundle "user/plugin"
and then you execute :BundleInstall on a new instance.
Elegant and simple, what else do you want?

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.

gvim pathogen issues

I downloaded pathogen.vim from github and put it in "autoload" directory under ~/.vim. However now when I fire up gvim, and do :helptags, it says "Argument required". The contents of my ~/.vimrc file are:
call pathogen#runtime_append_all_bundles()
call pathogen#helptags()
What am I missing?
Thanks.
Andy
PS: I am doing this so that I can install Nerdtree
--- EDIT 1 ---
Based on what I have seen so far, the pathogen.vim plugin from github did not work for me, so I had to download it from vim.org, and it worked. However now when I do "unzip nerd_tree -d ~/.vim/bundle" and then start up gvim, I can still not find nerdtree.
-----End ---------
According to the pathogen README on github site, you should use :Helptags instead of :helptags. With :Helptags command executed, pathogen should generate all the documentations under directory ~/.vim/bundle now.
helptags is a vim command which has nothing to do with pathogen. The helptags command in vim takes a directory as an argument where it will process .txt files and generate the tags file.
To tell if pathogen is loading correctly you should be able to attempt to :call pathogen#helptags(). If running that manually does not fail, then pathogen is loaded (this is actually unnecessary if you are not getting an error when you start vim because your .vimrc is already running these commands).
The next step for you to complete is to read the documentation provided here on how to install a plugin as a bundle. To summarize:
Make a directory called ~/.vim/bundle
Unzip/clone/copy files from an upstream source into ~/.vim/bundle/plugin-name/. This may contain many files and directories (ftplugin, autoload, doc, etc.).
Fire up vim and test that the functionality provided by plugin-name is available. If not, check that you have completed the above steps correctly.
If you're having problems with pathogen, just remember installing a bundle is not all that different than installing a plugin the normal way. The advantage is you get to keep all files and folders related to that specific plugin in their own directory. This allows you to manage each plugin individually and be confident you are only touching files related to that plugin.
I use pathogen and I find it great, but you don't need pathogen at all to use NERDTree.
Just put the files like this then issue :helptags ~/.vim/doc and it will work:
~/.vim/doc/NERD_tree.txt
~/.vim/nerdtree_plugin/exec_menuitem.vim
~/.vim/nerdtree_plugin/fs_menu.vim
~/.vim/plugin/NERD_tree.vim
My setup with pathogen is very standard:
~/.vim/bundle/NERD_tree/doc/NERD_tree.txt
~/.vim/bundle/NERD_tree/nerdtree_plugin/exec_menuitem.vim
~/.vim/bundle/NERD_tree/nerdtree_plugin/fs_menu.vim
~/.vim/bundle/NERD_tree/nerdtree_plugin/insert_image.vim <-- a custom script not included with the distribution
~/.vim/bundle/NERD_tree/plugin/NERD_tree.vim
and works like a charm.
It it helps, here are the first lines of my ~/.vimrc:
" This must be first, because it changes other options as side effect
set nocompatible
" Use pathogen to easily modify the runtime path to include all plugins under
" the ~/.vim/bundle directory
filetype off " force reloading *after* pathogen loaded
call pathogen#helptags()
call pathogen#runtime_append_all_bundles()
filetype plugin indent on " enable detection, plugins and indenting in one step

Moving vimfiles location breaks snipmate.vim?

I'm working on moving my whole vim config to my Dropbox folder in order share it between machines more effectively. To do this, I've changed my .vimrc to the following:
set runtimepath+=$HOME/My\ Documents/Dropbox/vim
source $HOME\My Documents\Dropbox\vim\vimrc.vim
vimrc.vim looks like this:
set nocompatible
filetype on
filetype plugin on
filetype indent on
syntax enable
The problem is then that snipMate.vim no longer works. I know that there aren't any plugins interfering with it, as I've done a fresh install of vim and removed all the other plugins. It worked perfectly before I moved the plugins to the dropbox folder. I think it may have something to do with the fact that the after directory in vimfiles doesn't seem to be getting read once I move the plugin folder to the dropbox (i.e. after/snipmate.vim only shows up in :scriptnames when I have vimfiles as the plugin folder). I've tried explicitly sourcing the script in the after directory by adding the following to my .vimrc:
source $HOME\My Documents\Dropbox\vim\after\plugin\snipMate.vim
but snipmate still doesn't work.
Any ideas on fixing this?
You have to add the after directory to 'runtimepath' if you want Vim to look for it.
set runtimepath^=$HOME/My\ Documents/Dropbox/vim
set runtimepath+=$HOME/My\ Documents/Dropbox/vim/after
This follows the normal behavior of having your personal vim directory sourced first, then the system-wide stuff, and finally your personal after directory.

Resources