This commit is contained in:
Frank Erens 2013-09-07 15:41:43 +02:00
commit 46131c9cae
13 changed files with 27 additions and 22 deletions

View File

@ -44,11 +44,11 @@ The following features and functionality are provided by the NERD tree:
as you left it as you left it
* You can have a separate NERD tree for each tab, share trees across tabs, * You can have a separate NERD tree for each tab, share trees across tabs,
or a mix of both. or a mix of both.
* By default the script overrides the default file browser (netw), so if * By default the script overrides the default file browser (netrw), so if
you :edit a directory a (slighly modified) NERD tree will appear in the you :edit a directory a (slightly modified) NERD tree will appear in the
current window current window
* A programmable menu system is provided (simulates right clicking on a node) * A programmable menu system is provided (simulates right clicking on a node)
* one default menu plugin is provided to perform basic filesytem * one default menu plugin is provided to perform basic filesystem
operations (create/delete/move/copy files/directories) operations (create/delete/move/copy files/directories)
* There's an API for adding your own keymappings * There's an API for adding your own keymappings

View File

@ -98,7 +98,7 @@ function! nerdtree#createDefaultBindings()
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapQuit, 'scope': "all", 'callback': s."closeTreeWindow" }) call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapQuit, 'scope': "all", 'callback': s."closeTreeWindow" })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapCWD, 'scope': "all", 'callback': s."chRootCwd" }) call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapCWD, 'scope': "all", 'callback': "nerdtree#chRootCwd" })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapRefreshRoot, 'scope': "all", 'callback': s."refreshRoot" }) call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapRefreshRoot, 'scope': "all", 'callback': s."refreshRoot" })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapRefresh, 'scope': "Node", 'callback': s."refreshCurrent" }) call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapRefresh, 'scope': "Node", 'callback': s."refreshCurrent" })
@ -227,6 +227,19 @@ function! nerdtree#invokeKeyMap(key)
call g:NERDTreeKeyMap.Invoke(a:key) call g:NERDTreeKeyMap.Invoke(a:key)
endfunction endfunction
" FUNCTION: nerdtree#loadClassFiles() {{{2
function! nerdtree#loadClassFiles()
runtime lib/nerdtree/path.vim
runtime lib/nerdtree/menu_controller.vim
runtime lib/nerdtree/menu_item.vim
runtime lib/nerdtree/key_map.vim
runtime lib/nerdtree/bookmark.vim
runtime lib/nerdtree/tree_file_node.vim
runtime lib/nerdtree/tree_dir_node.vim
runtime lib/nerdtree/opener.vim
runtime lib/nerdtree/creator.vim
endfunction
" FUNCTION: nerdtree#postSourceActions() {{{2 " FUNCTION: nerdtree#postSourceActions() {{{2
function! nerdtree#postSourceActions() function! nerdtree#postSourceActions()
call g:NERDTreeBookmark.CacheBookmarks(0) call g:NERDTreeBookmark.CacheBookmarks(0)
@ -1011,7 +1024,7 @@ endfunction
" FUNCTION: s:chRootCwd() {{{2 " FUNCTION: s:chRootCwd() {{{2
" changes the current root to CWD " changes the current root to CWD
function! s:chRootCwd() function! nerdtree#chRootCwd()
try try
let cwd = g:NERDTreePath.New(getcwd()) let cwd = g:NERDTreePath.New(getcwd())
catch /^NERDTree.InvalidArgumentsError/ catch /^NERDTree.InvalidArgumentsError/

View File

@ -83,12 +83,12 @@ The following features and functionality are provided by the NERD tree:
as you left it as you left it
* You can have a separate NERD tree for each tab, share trees across tabs, * You can have a separate NERD tree for each tab, share trees across tabs,
or a mix of both. or a mix of both.
* By default the script overrides the default file browser (netw), so if * By default the script overrides the default file browser (netrw), so if
you :edit a directory a (slighly modified) NERD tree will appear in the you :edit a directory a (slightly modified) NERD tree will appear in the
current window current window
* A programmable menu system is provided (simulates right clicking on a * A programmable menu system is provided (simulates right clicking on a
node) node)
* one default menu plugin is provided to perform basic filesytem * one default menu plugin is provided to perform basic filesystem
operations (create/delete/move/copy files/directories) operations (create/delete/move/copy files/directories)
* There's an API for adding your own keymappings * There's an API for adding your own keymappings
@ -228,7 +228,7 @@ gs......Same as s, but leave the cursor on the NERDTree..........|NERDTree-gs|
O.......Recursively open the selected directory..................|NERDTree-O| O.......Recursively open the selected directory..................|NERDTree-O|
x.......Close the current nodes parent...........................|NERDTree-x| x.......Close the current nodes parent...........................|NERDTree-x|
X.......Recursively close all children of the current node.......|NERDTree-X| X.......Recursively close all children of the current node.......|NERDTree-X|
e.......Edit the current dif.....................................|NERDTree-e| e.......Edit the current dir.....................................|NERDTree-e|
<CR>...............same as |NERDTree-o|. <CR>...............same as |NERDTree-o|.
double-click.......same as the |NERDTree-o| map. double-click.......same as the |NERDTree-o| map.
@ -780,7 +780,7 @@ If set to 1, doing a >
< <
will open up a "secondary" NERD tree instead of a netrw in the target window. will open up a "secondary" NERD tree instead of a netrw in the target window.
Secondary NERD trees behaves slighly different from a regular trees in the Secondary NERD trees behaves slightly different from a regular trees in the
following respects: following respects:
1. 'o' will open the selected file in the same window as the tree, 1. 'o' will open the selected file in the same window as the tree,
replacing it. replacing it.

View File

@ -67,7 +67,7 @@ function! s:Bookmark.BookmarkNames()
endfunction endfunction
" FUNCTION: Bookmark.CacheBookmarks(silent) {{{1 " FUNCTION: Bookmark.CacheBookmarks(silent) {{{1
" Class method to read all bookmarks from the bookmarks file intialize " Class method to read all bookmarks from the bookmarks file initialize
" bookmark objects for each one. " bookmark objects for each one.
" "
" Args: " Args:

View File

@ -7,11 +7,11 @@ let g:NERDTreeCreator = s:Creator
"FUNCTION: s:Creator._bindMappings() {{{1 "FUNCTION: s:Creator._bindMappings() {{{1
function! s:Creator._bindMappings() function! s:Creator._bindMappings()
call g:NERDTreeKeyMap.BindAll()
"make <cr> do the same as the default 'o' mapping "make <cr> do the same as the default 'o' mapping
exec "nnoremap <silent> <buffer> <cr> :call nerdtree#invokeKeyMap('". g:NERDTreeMapActivateNode ."')<cr>" exec "nnoremap <silent> <buffer> <cr> :call nerdtree#invokeKeyMap('". g:NERDTreeMapActivateNode ."')<cr>"
call g:NERDTreeKeyMap.BindAll()
command! -buffer -nargs=? Bookmark :call nerdtree#bookmarkNode('<args>') command! -buffer -nargs=? Bookmark :call nerdtree#bookmarkNode('<args>')
command! -buffer -complete=customlist,nerdtree#completeBookmarks -nargs=1 RevealBookmark :call nerdtree#revealBookmark('<args>') command! -buffer -complete=customlist,nerdtree#completeBookmarks -nargs=1 RevealBookmark :call nerdtree#revealBookmark('<args>')
command! -buffer -complete=customlist,nerdtree#completeBookmarks -nargs=1 OpenBookmark :call nerdtree#openBookmark('<args>') command! -buffer -complete=customlist,nerdtree#completeBookmarks -nargs=1 OpenBookmark :call nerdtree#openBookmark('<args>')

View File

@ -136,15 +136,7 @@ call s:initVariable("g:NERDTreeMapUpdirKeepOpen", "U")
call s:initVariable("g:NERDTreeMapCWD", "CD") call s:initVariable("g:NERDTreeMapCWD", "CD")
"SECTION: Load class files{{{2 "SECTION: Load class files{{{2
runtime plugin/nerdtree/path.vim call nerdtree#loadClassFiles()
runtime plugin/nerdtree/menu_controller.vim
runtime plugin/nerdtree/menu_item.vim
runtime plugin/nerdtree/key_map.vim
runtime plugin/nerdtree/bookmark.vim
runtime plugin/nerdtree/tree_file_node.vim
runtime plugin/nerdtree/tree_dir_node.vim
runtime plugin/nerdtree/opener.vim
runtime plugin/nerdtree/creator.vim
" SECTION: Commands {{{1 " SECTION: Commands {{{1
"============================================================ "============================================================