Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install nerdtree plugin on linuxmint for vim74

I am relatively new to the linux world and have started recently exploring the options it provides and I am fascinated by the power of vim editor.I have recently installed vim74 (the latest version of vim editor for linux)on my mintlinux machine. And tried tutorials that ship along with it and i am pretty comfortable with them.

Now, I want to add a new plugin called NERDTree for vim. I have gone through a lot of examples on google to search for a proper tutorial on the same but I see that they point to a relatively different file structure (Probably those tutorials were made for a different version of vim, if I understand it correctly) and that confuses me.

As I understand there is a plug-in manager called pathogen for vim which has to be placed in autoload directory under vim. But I don’t see any such directory called "autoload".

like image 227
Prakhar Avatar asked Feb 05 '15 09:02

Prakhar


People also ask

How do you open NERDTree in Neovim?

If you want to use NERDTree, you can open NERDTree (type :NERDTree ), navigate to your file, and then press t with cursor on the file name. This will open specific file in new tab.


3 Answers

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

like image 143
ChaosPredictor Avatar answered Nov 04 '22 18:11

ChaosPredictor


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.

  1. Go to the plugin's GitHub page, and click "Download ZIP".
  2. 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.

like image 38
Ingo Karkat Avatar answered Nov 04 '22 18:11

Ingo Karkat


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.

like image 5
SanD Avatar answered Nov 04 '22 18:11

SanD