Or add this line to your .vimrc file to to toggle when you hit F2 key:
map<F2>:NERDTreeToggle<CR>
Keyboard shortcuts:
t: Open the selected file in a new tab
i: Open the selected file in a horizontal split window
s: Open the selected file in a vertical split window
I: Toggle hidden files
R: Refresh the tree, useful if files change outside of Vim
Ctrl + w w: Cycle though all windows
Ctrl + w h: Takes you left a window
Ctrl + w j: Takes you down a window
Ctrl + w k: Takes you up a window
Ctrl + w l: Takes you right a window
Overal basic setup
Create a ~/.vimrc file:
" Install vim-plug if not foundif empty(glob('~/.vim/autoload/plug.vim')) silent !curl -fLo ~/.vim/autoload/plug.vim --create-dirs \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vimendif"RunPlugInstalliftherearemissingplugins
autocmdVimEnter*iflen(filter(values(g:plugs),'!isdirectory(v:val.dir)'))\|PlugInstall--sync|source$MYVIMRC\|endif
callplug#begin()" The default plugin directory will be as follows:"-Vim(Linux/macOS):'~/.vim/plugged'" Make sure you use single quotesPlug 'junegunn/vim-plug'Plug 'https://github.com/frazrepo/vim-rainbow'Plug 'https://github.com/scrooloose/nerdtree'Plug 'https://github.com/vim-airline/vim-airline'"Initializepluginsystem
callplug#end()setnumber
syntaxenablesetlaststatus=2
colorschemedelek
letg:rainbow_active=1
map<F4>:RainbowToggle<CR>
map<F2>:NERDTreeToggle<CR>