Compare commits

...

14 Commits
7.0.1 ... 7.1.3

Author SHA1 Message Date
rzvxa
9b465acb27 chore: bump version to 7.1.3. (#1414) 2024-07-20 08:31:16 +03:30
Lothar Droppelmann
09aec2cfca fix: typo in docs for show file lines setting (#1426)
Co-authored-by: Lothar Droppelmann <lothar.droppelmann@gmail.com>
2024-07-20 08:20:24 +03:30
Ali Rezvani
fbb71fcd90 docs: update FAQ snippets containing quit command. (#1417) 2024-05-14 19:09:02 +03:30
Ali Rezvani
6ad85ec29b feat: jump to bookmark table shortcut. (#1394)
Co-authored-by: Daniel Schreck <daniel.s.schreck@gmail.com>
2024-05-13 11:52:13 +03:30
Ali Rezvani
f3a4d8eaa8 chore: bump version to 7.1.2. (#1410) 2024-02-27 15:20:59 +03:30
Ali Rezvani
bdf81a086d fix: GetWinNum regex pattern. (#1409) 2024-02-11 16:27:41 +03:30
Ali Rezvani
60b5e602e9 fix: session restore for nerdtree buffers. (#1405) 2024-02-07 15:07:25 +03:30
Ali Rezvani
bc606c43e2 chore: bump version to 7.1.1 (#1401) 2024-01-09 16:53:16 +03:30
Ali Rezvani
6acfc48d80 fix: change default binding of filelines to FL. (#1400) 2024-01-09 15:55:55 +03:30
Ali Rezvani
aa29fbe481 fix: toggle zoom resizing (#1395)
Co-authored-by: Daniel Schreck <daniel.s.schreck@gmail.com>
2024-01-01 06:37:44 +03:30
Ali Rezvani
e5599272a9 chore: bump version to 7.1.0 (#1391) 2023-12-31 12:06:39 +03:30
Rocco Mao
ff9469a14a fix: mapping description in NERDTree.txt (#1393) 2023-12-26 04:38:17 +03:30
msibal6
fefea5d382 feat: add NERDTreeExplore command. (#1389)
* create a explorer command that opens a window tree at specified
directory

* update CHANGELOG.md

* Update CHANGELOG.md

* revert CHANGELOG.md

* CreateExplorerTree matches :Explore command

* prevent empty split when calling NERDTreeExplorer with invalid arg from modified buffer

* NERDTreeExplore/CreateExploreTree checks for hidden and
autowriteall settings
2023-12-23 03:47:43 +03:30
Leo Chung
a954661824 fix: typo in nerdtree.txt (#1390)
Signed-off-by: Leo Chung <gewalalb@gmail.com>
2023-12-20 18:55:39 +03:30
9 changed files with 149 additions and 21 deletions

View File

@@ -12,6 +12,21 @@
. .
- Pull Request Title n (PR Author) [PR Number](Link to PR) - Pull Request Title n (PR Author) [PR Number](Link to PR)
--> -->
#### 7.1
- **.3**:
- docs: update FAQ snippets containing quit command. (rzvxa) [#1417](https://github.com/preservim/nerdtree/pull/1417)
- feat: jump to bookmark table shortcut. (ds2606, rzvxa) [#1394](https://github.com/preservim/nerdtree/pull/1394)
- fix: typo in docs for show file lines setting. (lothardp) [#1426](https://github.com/preservim/nerdtree/pull/1426)
- **.2**:
- fix: GetWinNum regex pattern. (rzvxa) [#1409](https://github.com/preservim/nerdtree/pull/1409)
- fix: session restore for nerdtree buffers. (rzvxa) [#1405](https://github.com/preservim/nerdtree/pull/1405)
- **.1**:
- fix: change default binding of filelines to `FL`. (rzvxa) [#1400](https://github.com/preservim/nerdtree/pull/1400)
- fix: toggle zoom resizing. (ds2606) [#1395](https://github.com/preservim/nerdtree/pull/1395)
- **.0**:
- fix: typo in the docs. (bl4kraven) [#1390](https://github.com/preservim/nerdtree/pull/1390)
- feat: add NERDTreeExplore command. (msibal6) [#1389](https://github.com/preservim/nerdtree/pull/1389)
- fix: mapping description in NERDTree.txt. (roccomao) [#1393](https://github.com/preservim/nerdtree/pull/1393)
#### 7.0 #### 7.0
- **.1**: - **.1**:
- Fix NERDTreeFind to handle directory case sensitivity. (dangibson) [#1387](https://github.com/preservim/nerdtree/pull/1387) - Fix NERDTreeFind to handle directory case sensitivity. (dangibson) [#1387](https://github.com/preservim/nerdtree/pull/1387)

View File

@@ -150,6 +150,24 @@ autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists('s:std_in
### How can I close Vim or a tab automatically when NERDTree is the last window? ### How can I close Vim or a tab automatically when NERDTree is the last window?
Because of the changes in how Vim handles its `autocmd` and layout locking `quit` command is no longer available in Vim9 auto commands, Depending on which version you're running select one of these solutions.
__NeoVim users should be able to choose either one of them!__
#### Vim9
```vim
" Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | call feedkeys(":quit\<CR>:\<BS>") | endif
```
---
```vim
" Close the tab if NERDTree is the only window remaining in it.
autocmd BufEnter * if winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | call feedkeys(":quit\<CR>:\<BS>") | endif
```
#### Vim8 or older
```vim ```vim
" Exit Vim if NERDTree is the only window remaining in the only tab. " Exit Vim if NERDTree is the only window remaining in the only tab.
autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTree') && b:NERDTree.isTabTree() | quit | endif

View File

@@ -234,6 +234,38 @@ function! nerdtree#pathEquals(lhs, rhs) abort
endif endif
endfunction endfunction
"FUNCTION: nerdtree#onBufLeave() {{{2
" used for handling the nerdtree BufLeave/WinLeave events.
function! nerdtree#onBufLeave() abort
" detect whether we are in the middle of sourcing a session.
" if it is a buffer from the sourced session we need to restore it.
if exists('g:SessionLoad') && !exists('b:NERDTree')
let bname = bufname('%')
" is the buffer for a tab tree?
if bname =~# '^' . g:NERDTreeCreator.BufNamePrefix() . 'tab_\d\+$'
" rename loaded buffer and mark it as trash to prevent this event
" getting fired again
exec 'file TRASH_' . bname
" delete the trash buffer
exec 'bwipeout!'
" rescue the tab tree at the current working directory
call g:NERDTreeCreator.CreateTabTree(getcwd())
" is the buffer for a window tree?
elseif bname =~# '^' . g:NERDTreeCreator.BufNamePrefix(). 'win_\d\+$'
" rescue the window tree at the current working directory
call g:NERDTreeCreator.CreateWindowTree(getcwd())
else " unknown buffer type
" rename buffer to mark it as broken.
exec 'file BROKEN_' . bname
call nerdtree#echoError('Failed to restore "' . bname . '" from session. Is this session created with an older version of NERDTree?')
endif
else
if g:NERDTree.IsOpen()
call b:NERDTree.ui.saveScreenState()
endif
endif
endfunction
" SECTION: View Functions {{{1 " SECTION: View Functions {{{1
"============================================================ "============================================================

View File

@@ -70,6 +70,7 @@ function! nerdtree#ui_glue#createDefaultBindings() abort
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpRoot, 'scope': 'all', 'callback': s.'jumpToRoot' }) call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpRoot, 'scope': 'all', 'callback': s.'jumpToRoot' })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpNextSibling, 'scope': 'Node', 'callback': s.'jumpToNextSibling' }) call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpNextSibling, 'scope': 'Node', 'callback': s.'jumpToNextSibling' })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpPrevSibling, 'scope': 'Node', 'callback': s.'jumpToPrevSibling' }) call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpPrevSibling, 'scope': 'Node', 'callback': s.'jumpToPrevSibling' })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapJumpBookmarks, 'scope': 'all', 'callback': s.'jumpToBookmarks' })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenInTab, 'scope': 'Node', 'callback': s . 'openInNewTab' }) call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenInTab, 'scope': 'Node', 'callback': s . 'openInNewTab' })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenInTabSilent, 'scope': 'Node', 'callback': s . 'openInNewTabSilent' }) call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenInTabSilent, 'scope': 'Node', 'callback': s . 'openInNewTabSilent' })
@@ -496,6 +497,21 @@ function! s:jumpToSibling(node, forward) abort
call b:NERDTree.ui.centerView() call b:NERDTree.ui.centerView()
endfunction endfunction
" FUNCTION: s:jumpToBookmarks() {{{1
" moves the cursor to the bookmark table
function! s:jumpToBookmarks() abort
try
if b:NERDTree.ui.getShowBookmarks()
call g:NERDTree.CursorToBookmarkTable()
else
call b:NERDTree.ui.setShowBookmarks(1)
endif
catch /^NERDTree/
call nerdtree#echoError('Failed to jump to the bookmark table')
return
endtry
endfunction
" FUNCTION: nerdtree#ui_glue#openBookmark(name) {{{1 " FUNCTION: nerdtree#ui_glue#openBookmark(name) {{{1
" Open the Bookmark that has the specified name. This function provides the " Open the Bookmark that has the specified name. This function provides the
" implementation for the :OpenBookmark command. " implementation for the :OpenBookmark command.
@@ -642,6 +658,7 @@ endfunction
function! nerdtree#ui_glue#setupCommands() abort function! nerdtree#ui_glue#setupCommands() abort
command! -n=? -complete=dir -bar NERDTree :call g:NERDTreeCreator.CreateTabTree('<args>') command! -n=? -complete=dir -bar NERDTree :call g:NERDTreeCreator.CreateTabTree('<args>')
command! -n=? -complete=dir -bar NERDTreeToggle :call g:NERDTreeCreator.ToggleTabTree('<args>') command! -n=? -complete=dir -bar NERDTreeToggle :call g:NERDTreeCreator.ToggleTabTree('<args>')
command! -n=? -complete=dir -bar NERDTreeExplore :call g:NERDTreeCreator.CreateExploreTree('<args>')
command! -n=0 -bar NERDTreeClose :call g:NERDTree.Close() command! -n=0 -bar NERDTreeClose :call g:NERDTree.Close()
command! -n=1 -complete=customlist,nerdtree#completeBookmarks -bar NERDTreeFromBookmark call g:NERDTreeCreator.CreateTabTree('<args>') command! -n=1 -complete=customlist,nerdtree#completeBookmarks -bar NERDTreeFromBookmark call g:NERDTreeCreator.CreateTabTree('<args>')
command! -n=0 -bar NERDTreeMirror call g:NERDTreeCreator.CreateMirror() command! -n=0 -bar NERDTreeMirror call g:NERDTreeCreator.CreateMirror()

View File

@@ -287,7 +287,7 @@ I........Toggle whether hidden files displayed......................|NERDTree-I|
f........Toggle whether the file filters are used...................|NERDTree-f| f........Toggle whether the file filters are used...................|NERDTree-f|
F........Toggle whether files are displayed.........................|NERDTree-F| F........Toggle whether files are displayed.........................|NERDTree-F|
B........Toggle whether the bookmark table is displayed.............|NERDTree-B| B........Toggle whether the bookmark table is displayed.............|NERDTree-B|
L........Toggle whether the bookmark table is displayed.............|NERDTree-L| L........Toggle whether the number of lines in files is displayed..|NERDTree-FL|
q........Close the NERDTree window..................................|NERDTree-q| q........Close the NERDTree window..................................|NERDTree-q|
A........Zoom (maximize/minimize) the NERDTree window...............|NERDTree-A| A........Zoom (maximize/minimize) the NERDTree window...............|NERDTree-A|
@@ -603,9 +603,9 @@ Applies to: no restrictions.
Toggles whether the bookmarks table is displayed. Toggles whether the bookmarks table is displayed.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTree-L* *NERDTree-FL*
Default key: L Default key: FL
Map setting: *NERDTreeMapToggleFileLiness* Map setting: *NERDTreeMapToggleFileLines*
Applies to: no restrictions. Applies to: no restrictions.
Toggles whether the number of lines in files is displayed. Toggles whether the number of lines in files is displayed.
@@ -1073,18 +1073,18 @@ mapping and is useful for drastically shrinking the tree when you are
navigating to a different part of the tree. navigating to a different part of the tree.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTreeShowFilesLines* *NERDTreeFileLines*
Values: 0 or 1. Values: 0 or 1.
Default: 0. Default: 0.
If this setting is set to 1 then the NERDTree shows number of lines for each If this setting is set to 1 then the NERDTree shows number of lines for each
file. file.
This setting can be toggled dynamically, per tree, with the |NERDTree-L| This setting can be toggled dynamically, per tree, with the |NERDTree-FL|
mapping. mapping.
Use one of the follow lines for this setting: > Use one of the follow lines for this setting: >
let NERDTreeShowFilesLines=0 let NERDTreeFileLines=0
let NERDTreeShowFilesLines=1 let NERDTreeFileLines=1
< <
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
*NERDTreeShowHidden* *NERDTreeShowHidden*

View File

@@ -38,6 +38,29 @@ function! s:Creator.BufNamePrefix()
return 'NERD_tree_' return 'NERD_tree_'
endfunction endfunction
" FUNCTION: s:Creator.CreateExploreTree(dir) {{{1
function! s:Creator.CreateExploreTree(dir)
try
let path = g:NERDTreePath.New(a:dir)
catch /^NERDTree.InvalidArgumentsError/
call nerdtree#echo('Invalid directory name:' . a:dir)
return
endtry
let creator = s:Creator.New()
if getbufinfo('%')[0].changed && !&hidden && !&autowriteall
let l:splitLocation = g:NERDTreeWinPos ==# 'left' || g:NERDTreeWinPos ==# 'top' ? 'topleft ' : 'botright '
let l:splitDirection = g:NERDTreeWinPos ==# 'left' || g:NERDTreeWinPos ==# 'right' ? 'vertical' : ''
silent! execute l:splitLocation . l:splitDirection . ' new'
else
silent! execute 'enew'
endif
call creator.createWindowTree(a:dir)
"we want windowTree buffer to disappear after moving to any other buffer
setlocal bufhidden=wipe
endfunction
" FUNCTION: s:Creator.CreateTabTree(a:name) {{{1 " FUNCTION: s:Creator.CreateTabTree(a:name) {{{1
function! s:Creator.CreateTabTree(name) function! s:Creator.CreateTabTree(name)
let creator = s:Creator.New() let creator = s:Creator.New()
@@ -95,7 +118,7 @@ function! s:Creator.createWindowTree(dir)
"we need a unique name for each window tree buffer to ensure they are "we need a unique name for each window tree buffer to ensure they are
"all independent "all independent
exec g:NERDTreeCreatePrefix . ' edit ' . self._nextBufferName() exec g:NERDTreeCreatePrefix . ' edit ' . self._nextBufferName('win')
call self._createNERDTree(path, 'window') call self._createNERDTree(path, 'window')
let b:NERDTree._previousBuf = bufnr(previousBuf) let b:NERDTree._previousBuf = bufnr(previousBuf)
@@ -187,7 +210,7 @@ function! s:Creator._createTreeWin()
let l:splitSize = g:NERDTreeWinSize let l:splitSize = g:NERDTreeWinSize
if !g:NERDTree.ExistsForTab() if !g:NERDTree.ExistsForTab()
let t:NERDTreeBufName = self._nextBufferName() let t:NERDTreeBufName = self._nextBufferName('tab')
silent! execute l:splitLocation . l:splitDirection . ' ' . l:splitSize . ' new' silent! execute l:splitLocation . l:splitDirection . ' ' . l:splitSize . ' new'
silent! execute 'edit ' . t:NERDTreeBufName silent! execute 'edit ' . t:NERDTreeBufName
silent! execute l:splitDirection . ' resize '. l:splitSize silent! execute l:splitDirection . ' resize '. l:splitSize
@@ -221,10 +244,22 @@ function! s:Creator.New()
return newCreator return newCreator
endfunction endfunction
" FUNCTION: s:Creator._nextBufferName() {{{1 " FUNCTION: s:Creator._nextBufferName(type='') {{{1
" returns the buffer name for the next nerd tree " gets an optional buffer type of either 'tab' or 'win'.
function! s:Creator._nextBufferName() " returns the buffer name for the next nerd tree of such type.
let name = s:Creator.BufNamePrefix() . self._nextBufferNumber() function! s:Creator._nextBufferName(...)
if a:0 > 0
let type = a:1
else
let type = ''
end
let name = s:Creator.BufNamePrefix()
if type ==# 'tab'
let name = name . 'tab_'
elseif type ==# 'win'
let name = name . 'win_'
endif
let name = name . self._nextBufferNumber()
return name return name
endfunction endfunction

View File

@@ -144,7 +144,7 @@ function! s:NERDTree.GetWinNum()
" If WindowTree, there is no t:NERDTreeBufName variable. Search all windows. " If WindowTree, there is no t:NERDTreeBufName variable. Search all windows.
for w in range(1,winnr('$')) for w in range(1,winnr('$'))
if bufname(winbufnr(w)) =~# '^' . g:NERDTreeCreator.BufNamePrefix() . '\d\+$' if bufname(winbufnr(w)) =~# '^' . g:NERDTreeCreator.BufNamePrefix() . 'win_\d\+$'
return w return w
endif endif
endfor endfor

View File

@@ -62,6 +62,7 @@ function! s:UI._dumpHelp()
let help .= "\"\n\" ----------------------------\n" let help .= "\"\n\" ----------------------------\n"
let help .= "\" Bookmark table mappings~\n" let help .= "\" Bookmark table mappings~\n"
let help .= "\" double-click,\n" let help .= "\" double-click,\n"
let help .= '" '. g:NERDTreeMapJumpBookmarks .": jump to bookmark table\n"
let help .= '" '. g:NERDTreeMapActivateNode .": open bookmark\n" let help .= '" '. g:NERDTreeMapActivateNode .": open bookmark\n"
let help .= '" '. g:NERDTreeMapPreview .": preview file\n" let help .= '" '. g:NERDTreeMapPreview .": preview file\n"
let help .= '" '. g:NERDTreeMapPreview .": find dir in tree\n" let help .= '" '. g:NERDTreeMapPreview .": find dir in tree\n"
@@ -482,10 +483,10 @@ function! s:UI.toggleIgnoreFilter()
call self.centerView() call self.centerView()
endfunction endfunction
" FUNCTION: s:UI.toggleShowBookmarks() {{{1 " FUNCTION: s:UI.setShowBookmarks() {{{1
" Toggle the visibility of the Bookmark table. " Sets the visibility of the Bookmark table.
function! s:UI.toggleShowBookmarks() function! s:UI.setShowBookmarks(value)
let self._showBookmarks = !self._showBookmarks let self._showBookmarks = a:value
if self.getShowBookmarks() if self.getShowBookmarks()
call self.nerdtree.render() call self.nerdtree.render()
@@ -503,6 +504,12 @@ function! s:UI.toggleShowBookmarks()
call self.centerView() call self.centerView()
endfunction endfunction
" FUNCTION: s:UI.toggleShowBookmarks() {{{1
" Toggle the visibility of the Bookmark table.
function! s:UI.toggleShowBookmarks()
call self.setShowBookmarks(!self._showBookmarks)
endfunction
" FUNCTION: s:UI.toggleShowFiles() {{{1 " FUNCTION: s:UI.toggleShowFiles() {{{1
" toggles the display of hidden files " toggles the display of hidden files
function! s:UI.toggleShowFiles() function! s:UI.toggleShowFiles()
@@ -532,6 +539,9 @@ endfunction
" zoom (maximize/minimize) the NERDTree window " zoom (maximize/minimize) the NERDTree window
function! s:UI.toggleZoom() function! s:UI.toggleZoom()
if exists('b:NERDTreeZoomed') && b:NERDTreeZoomed if exists('b:NERDTreeZoomed') && b:NERDTreeZoomed
setlocal nowinfixwidth
wincmd =
setlocal winfixwidth
call nerdtree#exec('silent vertical resize '. g:NERDTreeWinSize, 1) call nerdtree#exec('silent vertical resize '. g:NERDTreeWinSize, 1)
let b:NERDTreeZoomed = 0 let b:NERDTreeZoomed = 0
else else

View File

@@ -101,6 +101,7 @@ endif
"SECTION: Init variable calls for key mappings {{{2 "SECTION: Init variable calls for key mappings {{{2
let g:NERDTreeMapCustomOpen = get(g:, 'NERDTreeMapCustomOpen', '<CR>') let g:NERDTreeMapCustomOpen = get(g:, 'NERDTreeMapCustomOpen', '<CR>')
let g:NERDTreeMapJumpBookmarks = get(g:, 'NERDTreeMapJumpBookmarks', 'gb')
let g:NERDTreeMapActivateNode = get(g:, 'NERDTreeMapActivateNode', 'o') let g:NERDTreeMapActivateNode = get(g:, 'NERDTreeMapActivateNode', 'o')
let g:NERDTreeMapChangeRoot = get(g:, 'NERDTreeMapChangeRoot', 'C') let g:NERDTreeMapChangeRoot = get(g:, 'NERDTreeMapChangeRoot', 'C')
let g:NERDTreeMapChdir = get(g:, 'NERDTreeMapChdir', 'cd') let g:NERDTreeMapChdir = get(g:, 'NERDTreeMapChdir', 'cd')
@@ -131,7 +132,7 @@ let g:NERDTreeMapToggleBookmarks = get(g:, 'NERDTreeMapToggleBookmarks', 'B')
let g:NERDTreeMapToggleFiles = get(g:, 'NERDTreeMapToggleFiles', 'F') let g:NERDTreeMapToggleFiles = get(g:, 'NERDTreeMapToggleFiles', 'F')
let g:NERDTreeMapToggleFilters = get(g:, 'NERDTreeMapToggleFilters', 'f') let g:NERDTreeMapToggleFilters = get(g:, 'NERDTreeMapToggleFilters', 'f')
let g:NERDTreeMapToggleHidden = get(g:, 'NERDTreeMapToggleHidden', 'I') let g:NERDTreeMapToggleHidden = get(g:, 'NERDTreeMapToggleHidden', 'I')
let g:NERDTreeMapToggleFileLines = get(g:, 'NERDTreeMapToggleFileLines', 'L') let g:NERDTreeMapToggleFileLines = get(g:, 'NERDTreeMapToggleFileLines', 'FL')
let g:NERDTreeMapToggleZoom = get(g:, 'NERDTreeMapToggleZoom', 'A') let g:NERDTreeMapToggleZoom = get(g:, 'NERDTreeMapToggleZoom', 'A')
let g:NERDTreeMapUpdir = get(g:, 'NERDTreeMapUpdir', 'u') let g:NERDTreeMapUpdir = get(g:, 'NERDTreeMapUpdir', 'u')
let g:NERDTreeMapUpdirKeepOpen = get(g:, 'NERDTreeMapUpdirKeepOpen', 'U') let g:NERDTreeMapUpdirKeepOpen = get(g:, 'NERDTreeMapUpdirKeepOpen', 'U')
@@ -151,7 +152,7 @@ call nerdtree#ui_glue#setupCommands()
"============================================================ "============================================================
augroup NERDTree augroup NERDTree
"Save the cursor position whenever we close the nerd tree "Save the cursor position whenever we close the nerd tree
exec 'autocmd BufLeave,WinLeave '. g:NERDTreeCreator.BufNamePrefix() .'* if g:NERDTree.IsOpen() | call b:NERDTree.ui.saveScreenState() | endif' exec 'autocmd BufLeave,WinLeave '. g:NERDTreeCreator.BufNamePrefix() .'* call nerdtree#onBufLeave()'
"disallow insert mode in the NERDTree "disallow insert mode in the NERDTree
exec 'autocmd BufEnter,WinEnter '. g:NERDTreeCreator.BufNamePrefix() .'* stopinsert' exec 'autocmd BufEnter,WinEnter '. g:NERDTreeCreator.BufNamePrefix() .'* stopinsert'