Skip to content

Instantly share code, notes, and snippets.

@SofijaErkin
Last active June 19, 2022 03:00
Show Gist options
  • Save SofijaErkin/ae3505742a431c343f54a9a995fd7e2b to your computer and use it in GitHub Desktop.
Save SofijaErkin/ae3505742a431c343f54a9a995fd7e2b to your computer and use it in GitHub Desktop.
Plugin NERDTree for VIM

NERDTree for VIM

Add to ~/.vimrc, back VIM normal state with command ":BundleInstall" to

install:

call vundle#begin()

...

Plugin 'https://github.com/scrooloose/nerdtree.git'

...

call vundle#end()

Add NERDTree(File Content Tree) configuration to ~/.vimrc:

" NERDTree config

map <F4> :NERDTreeToggle<CR>  " F4 control the content tree

autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTreeType") && b:NERDTreeType=="primary" ) | q | endif                   

" exit vim during the current winter being the last content tree winer

Also,

reopen and active ~/.vimrc, use "F4" to open file content tree,

use key UP and DOWN to move between the below and upstairs content tree,

use key ENTER to open file under content tree.

And, the NERDTree Keyboard Shortcuts:

click "CTRL+w+w" to switch windows between the file content tree window and

the file editing window. Cursor just use "Ctrl+w+h" to focus the left tree

content, and "Ctrl+w+l" to focus the right file display window.

Also,

"o" to open and jump to file at the current window,

"go" to open but not jump to file at the current window,

"t" to open and jump to bookmarks at the current window,

"T" to open but not jump to bookmarks at the current window,

"gT" to switch the next bookmark,

"gt" to switch the upstairs bookmark,

":tabc"(VIM command) to close the current bookmark.

Refer:

Build VIM into IDE step by step(Chinese BLog)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment