How to install nerdtree for vim using pathogen

Lately, I’ve been experimenting with vim because of many posts I’ve read about how productive of a coder you can become, once you’re used to all of the commands and shortcuts: here, here, and here.

When browsing the interwebs, I found that many people use a cool plugin called nerdtree to navigate between files quicker.  I started to try to install the plugin for vim and for me, it was difficult.  I’m running Ubuntu 12.04 and am relatively new to vim. So I’m going to share the process I went through to get it up and running.

Install Pathogen

I’ve found that if you install a vim plugin called pathogen, that it makes installing other plugins a lot easier.

First, you need to create the environment for pathogen by entering these commands into your terminal:

mkdir -p ~/.vim/autoload ~/.vim/bundle;
curl -Sso ~/.vim/autoload/pathogen.vim https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim

If that didn’t work for you, you will need to install curl by entering this into your terminal:

sudo apt-get install curl

if you are new to vim and do not have a .vimrc file, create one with vim:

vim ~/.vimrc

and paste the following lines to the end of your .vimrc file:

” Pathogen
execute pathogen#infect()
call pathogen#helptags() ” generate helptags for everything in ‘runtimepath’
syntax on
filetype plugin indent on

Now we’re ready to install nerdtree. (or any other vim plugin for that matter)

Install nerdtree

You can easily download and install nerdtree using this command:

cd ~/.vim/bundle
git clone https://github.com/scrooloose/nerdtree.git

Next, start a vim session and type

:help NERD_tree.txt

To toggle the directory listing between visible and hidden states use

:NERDTreeToggle

Advertisements
    • Inco Gnito
    • January 19th, 2014

    simple and helpful
    thanks

  1. Entries in .vimrc file for pathogen which worked for me( OS : Ubuntu LTS 12.04) :

    call pathogen#infect()
    call pathogen#helptags()

  2. Hello admin do you need unlimited content for
    your site ? What if you could copy content from other websites, make
    it unique and publish on your page – i know the right tool for you,
    just search in google:
    Ziakdra’s article tool

    • David
    • February 12th, 2015

    Thanks ❤

    For people that can't install pathogen with curl like me (even having curl installed):

    1) Go to https://raw.github.com/tpope/vim-pathogen/master/autoload/pathogen.vim and download the file.
    2) Move the file from where you downloaded it to the autoload directory: mv pathogen.vim ~/.vim/autoload

    And that's all, then you can continue with the other steps. If you have problems starting vim is probably beacuse of the quotes on the file, you need to edit and change then in your computer.

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: