mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 03:43:50 -05:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e7ebee3084 | ||
|
|
1239f78baf | ||
|
|
5f4c005771 | ||
|
|
9e0a0b6a43 | ||
|
|
5c85d28285 | ||
|
|
f65bc62fac | ||
|
|
9b12953343 | ||
|
|
84f9793231 | ||
|
|
1f46ecf4b8 | ||
|
|
eef90bf320 | ||
|
|
3796a8799a | ||
|
|
c726655d23 |
@@ -211,6 +211,7 @@ 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 dif.....................................|NERDTree-e|
|
||||||
|
|
||||||
|
<CR>...............same as |NERDTree-o|.
|
||||||
double-click.......same as the |NERDTree-o| map.
|
double-click.......same as the |NERDTree-o| map.
|
||||||
middle-click.......same as |NERDTree-i| for files, same as
|
middle-click.......same as |NERDTree-i| for files, same as
|
||||||
|NERDTree-e| for dirs.
|
|NERDTree-e| for dirs.
|
||||||
@@ -221,8 +222,8 @@ P.......Jump to the root node....................................|NERDTree-P|
|
|||||||
p.......Jump to current nodes parent.............................|NERDTree-p|
|
p.......Jump to current nodes parent.............................|NERDTree-p|
|
||||||
K.......Jump up inside directories at the current tree depth.....|NERDTree-K|
|
K.......Jump up inside directories at the current tree depth.....|NERDTree-K|
|
||||||
J.......Jump down inside directories at the current tree depth...|NERDTree-J|
|
J.......Jump down inside directories at the current tree depth...|NERDTree-J|
|
||||||
<C-j>...Jump down to the next sibling of the current directory...|NERDTree-c-j|
|
<C-J>...Jump down to the next sibling of the current directory...|NERDTree-C-J|
|
||||||
<C-k>...Jump up to the previous sibling of the current directory.|NERDTree-c-k|
|
<C-K>...Jump up to the previous sibling of the current directory.|NERDTree-C-K|
|
||||||
|
|
||||||
C.......Change the tree root to the selected dir.................|NERDTree-C|
|
C.......Change the tree root to the selected dir.................|NERDTree-C|
|
||||||
u.......Move the tree root up one directory......................|NERDTree-u|
|
u.......Move the tree root up one directory......................|NERDTree-u|
|
||||||
@@ -430,16 +431,16 @@ If the cursor is already on the last node then do the following:
|
|||||||
* go to the last child of that node
|
* go to the last child of that node
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*NERDTree-c-j*
|
*NERDTree-C-J*
|
||||||
Default key: <C-j>
|
Default key: <C-J>
|
||||||
Map option: NERDTreeMapJumpNextSibling
|
Map option: NERDTreeMapJumpNextSibling
|
||||||
Applies to: files and directories.
|
Applies to: files and directories.
|
||||||
|
|
||||||
Jump to the next sibling of the selected node.
|
Jump to the next sibling of the selected node.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*NERDTree-c-k*
|
*NERDTree-C-K*
|
||||||
Default key: <C-k>
|
Default key: <C-K>
|
||||||
Map option: NERDTreeMapJumpPrevSibling
|
Map option: NERDTreeMapJumpPrevSibling
|
||||||
Applies to: files and directories.
|
Applies to: files and directories.
|
||||||
|
|
||||||
@@ -497,6 +498,14 @@ Applies to: files and directories.
|
|||||||
|
|
||||||
Display the filesystem menu. See |NERDTreeFilesysMenu| for details.
|
Display the filesystem menu. See |NERDTreeFilesysMenu| for details.
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------
|
||||||
|
*NERDTree-cd*
|
||||||
|
Default key: cd
|
||||||
|
Map option: NERDTreeMapChdir
|
||||||
|
Applies to: files and directories.
|
||||||
|
|
||||||
|
Change vims current working directory to that of the selected node.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*NERDTree-I*
|
*NERDTree-I*
|
||||||
Default key: I
|
Default key: I
|
||||||
@@ -679,7 +688,7 @@ If set to 1, the NERD tree window will center around the cursor if it moves to
|
|||||||
within |'NERDTreeAutoCenterThreshold'| lines of the top/bottom of the window.
|
within |'NERDTreeAutoCenterThreshold'| lines of the top/bottom of the window.
|
||||||
|
|
||||||
This is ONLY done in response to tree navigation mappings,
|
This is ONLY done in response to tree navigation mappings,
|
||||||
i.e. |NERDTree-J| |NERDTree-K| |NERDTree-C-J| |NERDTree-c-K| |NERDTree-p|
|
i.e. |NERDTree-J| |NERDTree-K| |NERDTree-C-J| |NERDTree-C-K| |NERDTree-p|
|
||||||
|NERDTree-P|
|
|NERDTree-P|
|
||||||
|
|
||||||
The centering is done with a |zz| operation.
|
The centering is done with a |zz| operation.
|
||||||
@@ -742,7 +751,7 @@ Values: 0 or 1.
|
|||||||
Default: 1.
|
Default: 1.
|
||||||
|
|
||||||
If set to 1, the current cursor line in the NERD tree buffer will be
|
If set to 1, the current cursor line in the NERD tree buffer will be
|
||||||
highlighted. This is done using the |cursorline| option.
|
highlighted. This is done using the |'cursorline'| option.
|
||||||
|
|
||||||
------------------------------------------------------------------------------
|
------------------------------------------------------------------------------
|
||||||
*'NERDTreeHijackNetrw'*
|
*'NERDTreeHijackNetrw'*
|
||||||
@@ -988,6 +997,15 @@ The latest dev versions are on github
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
6. Changelog *NERDTreeChangelog*
|
6. Changelog *NERDTreeChangelog*
|
||||||
|
|
||||||
|
3.1.1
|
||||||
|
- fix a bug where a non-listed no-name buffer was getting created every
|
||||||
|
time the tree windows was created, thanks to Derek Wyatt and owen1
|
||||||
|
- make <CR> behave the same as the 'o' mapping
|
||||||
|
- some helptag fixes in the doc, thanks strull
|
||||||
|
- fix a bug when using :set nohidden and opening a file where the previous
|
||||||
|
buf was modified. Thanks iElectric
|
||||||
|
- other minor fixes
|
||||||
|
|
||||||
3.1.0
|
3.1.0
|
||||||
New features:
|
New features:
|
||||||
- add mappings to open files in a vsplit, see :help NERDTree-s and :help
|
- add mappings to open files in a vsplit, see :help NERDTree-s and :help
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
" File: NERD_tree.vim
|
" File: NERD_tree.vim
|
||||||
" Description: vim global plugin that provides a nice tree explorer
|
" Description: vim global plugin that provides a nice tree explorer
|
||||||
" Maintainer: Martin Grenfell <martin_grenfell at msn dot com>
|
" Maintainer: Martin Grenfell <martin_grenfell at msn dot com>
|
||||||
" Last Change: 27 Jan, 2009
|
" Last Change: 7 Jun, 2009
|
||||||
" License: This program is free software. It comes without any warranty,
|
" License: This program is free software. It comes without any warranty,
|
||||||
" to the extent permitted by applicable law. You can redistribute
|
" to the extent permitted by applicable law. You can redistribute
|
||||||
" it and/or modify it under the terms of the Do What The Fuck You
|
" it and/or modify it under the terms of the Do What The Fuck You
|
||||||
@@ -10,7 +10,7 @@
|
|||||||
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
" See http://sam.zoy.org/wtfpl/COPYING for more details.
|
||||||
"
|
"
|
||||||
" ============================================================================
|
" ============================================================================
|
||||||
let s:NERD_tree_version = '3.1.0'
|
let s:NERD_tree_version = '3.1.1'
|
||||||
|
|
||||||
" SECTION: Script init stuff {{{1
|
" SECTION: Script init stuff {{{1
|
||||||
"============================================================
|
"============================================================
|
||||||
@@ -154,7 +154,7 @@ command! -n=? -complete=dir -bar NERDTree :call s:initNerdTree('<args>')
|
|||||||
command! -n=? -complete=dir -bar NERDTreeToggle :call s:toggle('<args>')
|
command! -n=? -complete=dir -bar NERDTreeToggle :call s:toggle('<args>')
|
||||||
command! -n=0 -bar NERDTreeClose :call s:closeTreeIfOpen()
|
command! -n=0 -bar NERDTreeClose :call s:closeTreeIfOpen()
|
||||||
command! -n=1 -complete=customlist,s:completeBookmarks -bar NERDTreeFromBookmark call s:initNerdTree('<args>')
|
command! -n=1 -complete=customlist,s:completeBookmarks -bar NERDTreeFromBookmark call s:initNerdTree('<args>')
|
||||||
command! -n=0 -complete=customlist,s:completeNERDTreeMirrors -bar NERDTreeMirror call s:initNerdTreeMirror()
|
command! -n=0 -bar NERDTreeMirror call s:initNerdTreeMirror()
|
||||||
" SECTION: Auto commands {{{1
|
" SECTION: Auto commands {{{1
|
||||||
"============================================================
|
"============================================================
|
||||||
augroup NERDTree
|
augroup NERDTree
|
||||||
@@ -796,12 +796,12 @@ function! s:TreeFileNode.open()
|
|||||||
call s:exec(winnr . "wincmd w")
|
call s:exec(winnr . "wincmd w")
|
||||||
|
|
||||||
else
|
else
|
||||||
if !s:isWindowUsable(winnr("#")) && s:firstNormalWindow() ==# -1
|
if !s:isWindowUsable(winnr("#")) && s:firstUsableWindow() ==# -1
|
||||||
call self.openSplit()
|
call self.openSplit()
|
||||||
else
|
else
|
||||||
try
|
try
|
||||||
if !s:isWindowUsable(winnr("#"))
|
if !s:isWindowUsable(winnr("#"))
|
||||||
call s:exec(s:firstNormalWindow() . "wincmd w")
|
call s:exec(s:firstUsableWindow() . "wincmd w")
|
||||||
else
|
else
|
||||||
call s:exec('wincmd p')
|
call s:exec('wincmd p')
|
||||||
endif
|
endif
|
||||||
@@ -2355,12 +2355,13 @@ function! s:createTreeWin()
|
|||||||
"create the nerd tree window
|
"create the nerd tree window
|
||||||
let splitLocation = g:NERDTreeWinPos ==# "left" ? "topleft " : "botright "
|
let splitLocation = g:NERDTreeWinPos ==# "left" ? "topleft " : "botright "
|
||||||
let splitSize = g:NERDTreeWinSize
|
let splitSize = g:NERDTreeWinSize
|
||||||
silent! exec splitLocation . 'vertical ' . splitSize . ' new'
|
|
||||||
|
|
||||||
if !exists('t:NERDTreeBufName')
|
if !exists('t:NERDTreeBufName')
|
||||||
let t:NERDTreeBufName = s:nextBufferName()
|
let t:NERDTreeBufName = s:nextBufferName()
|
||||||
|
silent! exec splitLocation . 'vertical ' . splitSize . ' new'
|
||||||
silent! exec "edit " . t:NERDTreeBufName
|
silent! exec "edit " . t:NERDTreeBufName
|
||||||
else
|
else
|
||||||
|
silent! exec splitLocation . 'vertical ' . splitSize . ' split'
|
||||||
silent! exec "buffer " . t:NERDTreeBufName
|
silent! exec "buffer " . t:NERDTreeBufName
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -2404,6 +2405,7 @@ function! s:dumpHelp()
|
|||||||
let @h=@h."\" ============================\n"
|
let @h=@h."\" ============================\n"
|
||||||
let @h=@h."\" File node mappings~\n"
|
let @h=@h."\" File node mappings~\n"
|
||||||
let @h=@h."\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n"
|
let @h=@h."\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n"
|
||||||
|
let @h=@h."\" <CR>,\n"
|
||||||
if b:NERDTreeType ==# "primary"
|
if b:NERDTreeType ==# "primary"
|
||||||
let @h=@h."\" ". g:NERDTreeMapActivateNode .": open in prev window\n"
|
let @h=@h."\" ". g:NERDTreeMapActivateNode .": open in prev window\n"
|
||||||
else
|
else
|
||||||
@@ -2516,14 +2518,15 @@ function! s:echoError(msg)
|
|||||||
call s:echo(a:msg)
|
call s:echo(a:msg)
|
||||||
echohl normal
|
echohl normal
|
||||||
endfunction
|
endfunction
|
||||||
"FUNCTION: s:firstNormalWindow(){{{2
|
"FUNCTION: s:firstUsableWindow(){{{2
|
||||||
"find the window number of the first normal window
|
"find the window number of the first normal window
|
||||||
function! s:firstNormalWindow()
|
function! s:firstUsableWindow()
|
||||||
let i = 1
|
let i = 1
|
||||||
while i <= winnr("$")
|
while i <= winnr("$")
|
||||||
let bnum = winbufnr(i)
|
let bnum = winbufnr(i)
|
||||||
if bnum != -1 && getbufvar(bnum, '&buftype') ==# ''
|
if bnum != -1 && getbufvar(bnum, '&buftype') ==# ''
|
||||||
\ && !getwinvar(i, '&previewwindow')
|
\ && !getwinvar(i, '&previewwindow')
|
||||||
|
\ && (!getbufvar(bnum, '&modified') || &hidden)
|
||||||
return i
|
return i
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@@ -2630,8 +2633,8 @@ function! s:isTreeOpen()
|
|||||||
return s:getTreeWinNum() != -1
|
return s:getTreeWinNum() != -1
|
||||||
endfunction
|
endfunction
|
||||||
"FUNCTION: s:isWindowUsable(winnumber) {{{2
|
"FUNCTION: s:isWindowUsable(winnumber) {{{2
|
||||||
"Returns 1 if opening a file from the tree in the given window requires it to
|
"Returns 0 if opening a file from the tree in the given window requires it to
|
||||||
"be split
|
"be split, 1 otherwise
|
||||||
"
|
"
|
||||||
"Args:
|
"Args:
|
||||||
"winnumber: the number of the window in question
|
"winnumber: the number of the window in question
|
||||||
@@ -3042,7 +3045,8 @@ function! s:activateNode(forceKeepWindowOpen)
|
|||||||
call bookmark.toRoot()
|
call bookmark.toRoot()
|
||||||
else
|
else
|
||||||
if bookmark.validate()
|
if bookmark.validate()
|
||||||
call (s:TreeFileNode.New(bookmark.path)).open()
|
let n = s:TreeFileNode.New(bookmark.path)
|
||||||
|
call n.open()
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
@@ -3058,6 +3062,7 @@ function! s:bindMappings()
|
|||||||
|
|
||||||
exec "nnoremap <silent> <buffer> ". g:NERDTreeMapActivateNode . " :call <SID>activateNode(0)<cr>"
|
exec "nnoremap <silent> <buffer> ". g:NERDTreeMapActivateNode . " :call <SID>activateNode(0)<cr>"
|
||||||
exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenSplit ." :call <SID>openEntrySplit(0,0)<cr>"
|
exec "nnoremap <silent> <buffer> ". g:NERDTreeMapOpenSplit ." :call <SID>openEntrySplit(0,0)<cr>"
|
||||||
|
exec "nnoremap <silent> <buffer> <cr> :call <SID>activateNode(0)<cr>"
|
||||||
|
|
||||||
exec "nnoremap <silent> <buffer> ". g:NERDTreeMapPreview ." :call <SID>previewNode(0)<cr>"
|
exec "nnoremap <silent> <buffer> ". g:NERDTreeMapPreview ." :call <SID>previewNode(0)<cr>"
|
||||||
exec "nnoremap <silent> <buffer> ". g:NERDTreeMapPreviewSplit ." :call <SID>previewNode(1)<cr>"
|
exec "nnoremap <silent> <buffer> ". g:NERDTreeMapPreviewSplit ." :call <SID>previewNode(1)<cr>"
|
||||||
|
|||||||
Reference in New Issue
Block a user