How to install nerdtree plugin on linuxmint for vim74
step1: First install pathogen
Pathogen
step2: run it in the terminal
git clone https://github.com/scrooloose/nerdtree.git ~/.vim/bundle/nerdtree
source
step3: if you what to open a NERDTree automatically when vim starts up add:
autocmd vimenter * NERDTree
to your .vimrc file in (~/.vimrc). from same source as step 2
You don't need a plugin manager; it just makes management and updates easier [when you have several plugins]. The simplest (and still perfectly valid) way is to just unzip the plugin(s) into a ~/.vim
directory.
- Go to the plugin's GitHub page, and click "Download ZIP".
- Unzip to
~/.vim
:
$ mkdir ~/.vim
$ unzip path/to/nerdtree-master.zip -d /tmp
$ mv /tmp/nerdtree-master/* ~/.vim/
$ rmdir /tmp/nerdtree-master
Ensure that the directory structure (autoload
, plugin
etc.) is directly inside ~/.vim
!
Plugin managers
A plugin manager will allow you to keep the plugins in separate directories. Pathogen is one of the simplest and earliest. You can use git
to directly clone and update from GitHub; Pathogen extends Vim's 'runtimepath'
so that these additional directories (called bundles) are considered.
Other plugin managers include capabilities for automatically locating and downloading plugins (from sources like GitHub, vim.org, etc.) They are more comfortable (especially if you don't know Git well), but also add complexity.
I install my vim plugins using Plug. First install Plug using the command:
curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
(refer to their installation page if required).
Next in your ~/.vimrc
add these lines:
call plug#begin()
Plug 'scrooloose/nerdtree'
call plug#end()
autocmd VimEnter * NERDTree
Now from your vim execute the command :PlugInstall nerdtree
(or just :PlugInstall
which will install all plugins listed). This should do the trick. In the .vimrc file 'scrooloose/nerdtree' comes from their github url.