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|
|
||||
e.......Edit the current dif.....................................|NERDTree-e|
|
||||
|
||||
<CR>...............same as |NERDTree-o|.
|
||||
double-click.......same as the |NERDTree-o| map.
|
||||
middle-click.......same as |NERDTree-i| for files, same as
|
||||
|NERDTree-e| for dirs.
|
||||
@@ -221,8 +222,8 @@ P.......Jump to the root node....................................|NERDTree-P|
|
||||
p.......Jump to current nodes parent.............................|NERDTree-p|
|
||||
K.......Jump up inside directories at the current tree depth.....|NERDTree-K|
|
||||
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-k>...Jump up to the previous sibling of the current directory.|NERDTree-c-k|
|
||||
<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.......Change the tree root to the selected dir.................|NERDTree-C|
|
||||
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
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*NERDTree-c-j*
|
||||
Default key: <C-j>
|
||||
*NERDTree-C-J*
|
||||
Default key: <C-J>
|
||||
Map option: NERDTreeMapJumpNextSibling
|
||||
Applies to: files and directories.
|
||||
|
||||
Jump to the next sibling of the selected node.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*NERDTree-c-k*
|
||||
Default key: <C-k>
|
||||
*NERDTree-C-K*
|
||||
Default key: <C-K>
|
||||
Map option: NERDTreeMapJumpPrevSibling
|
||||
Applies to: files and directories.
|
||||
|
||||
@@ -497,6 +498,14 @@ Applies to: files and directories.
|
||||
|
||||
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*
|
||||
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.
|
||||
|
||||
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|
|
||||
|
||||
The centering is done with a |zz| operation.
|
||||
@@ -742,7 +751,7 @@ Values: 0 or 1.
|
||||
Default: 1.
|
||||
|
||||
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'*
|
||||
@@ -988,6 +997,15 @@ The latest dev versions are on github
|
||||
==============================================================================
|
||||
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
|
||||
New features:
|
||||
- add mappings to open files in a vsplit, see :help NERDTree-s and :help
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
" File: NERD_tree.vim
|
||||
" Description: vim global plugin that provides a nice tree explorer
|
||||
" 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,
|
||||
" 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
|
||||
@@ -10,7 +10,7 @@
|
||||
" 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
|
||||
"============================================================
|
||||
@@ -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=0 -bar NERDTreeClose :call s:closeTreeIfOpen()
|
||||
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
|
||||
"============================================================
|
||||
augroup NERDTree
|
||||
@@ -796,12 +796,12 @@ function! s:TreeFileNode.open()
|
||||
call s:exec(winnr . "wincmd w")
|
||||
|
||||
else
|
||||
if !s:isWindowUsable(winnr("#")) && s:firstNormalWindow() ==# -1
|
||||
if !s:isWindowUsable(winnr("#")) && s:firstUsableWindow() ==# -1
|
||||
call self.openSplit()
|
||||
else
|
||||
try
|
||||
if !s:isWindowUsable(winnr("#"))
|
||||
call s:exec(s:firstNormalWindow() . "wincmd w")
|
||||
call s:exec(s:firstUsableWindow() . "wincmd w")
|
||||
else
|
||||
call s:exec('wincmd p')
|
||||
endif
|
||||
@@ -2355,12 +2355,13 @@ function! s:createTreeWin()
|
||||
"create the nerd tree window
|
||||
let splitLocation = g:NERDTreeWinPos ==# "left" ? "topleft " : "botright "
|
||||
let splitSize = g:NERDTreeWinSize
|
||||
silent! exec splitLocation . 'vertical ' . splitSize . ' new'
|
||||
|
||||
if !exists('t:NERDTreeBufName')
|
||||
let t:NERDTreeBufName = s:nextBufferName()
|
||||
silent! exec splitLocation . 'vertical ' . splitSize . ' new'
|
||||
silent! exec "edit " . t:NERDTreeBufName
|
||||
else
|
||||
silent! exec splitLocation . 'vertical ' . splitSize . ' split'
|
||||
silent! exec "buffer " . t:NERDTreeBufName
|
||||
endif
|
||||
|
||||
@@ -2404,6 +2405,7 @@ function! s:dumpHelp()
|
||||
let @h=@h."\" ============================\n"
|
||||
let @h=@h."\" File node mappings~\n"
|
||||
let @h=@h."\" ". (g:NERDTreeMouseMode ==# 3 ? "single" : "double") ."-click,\n"
|
||||
let @h=@h."\" <CR>,\n"
|
||||
if b:NERDTreeType ==# "primary"
|
||||
let @h=@h."\" ". g:NERDTreeMapActivateNode .": open in prev window\n"
|
||||
else
|
||||
@@ -2516,14 +2518,15 @@ function! s:echoError(msg)
|
||||
call s:echo(a:msg)
|
||||
echohl normal
|
||||
endfunction
|
||||
"FUNCTION: s:firstNormalWindow(){{{2
|
||||
"FUNCTION: s:firstUsableWindow(){{{2
|
||||
"find the window number of the first normal window
|
||||
function! s:firstNormalWindow()
|
||||
function! s:firstUsableWindow()
|
||||
let i = 1
|
||||
while i <= winnr("$")
|
||||
let bnum = winbufnr(i)
|
||||
if bnum != -1 && getbufvar(bnum, '&buftype') ==# ''
|
||||
\ && !getwinvar(i, '&previewwindow')
|
||||
\ && (!getbufvar(bnum, '&modified') || &hidden)
|
||||
return i
|
||||
endif
|
||||
|
||||
@@ -2630,8 +2633,8 @@ function! s:isTreeOpen()
|
||||
return s:getTreeWinNum() != -1
|
||||
endfunction
|
||||
"FUNCTION: s:isWindowUsable(winnumber) {{{2
|
||||
"Returns 1 if opening a file from the tree in the given window requires it to
|
||||
"be split
|
||||
"Returns 0 if opening a file from the tree in the given window requires it to
|
||||
"be split, 1 otherwise
|
||||
"
|
||||
"Args:
|
||||
"winnumber: the number of the window in question
|
||||
@@ -3042,7 +3045,8 @@ function! s:activateNode(forceKeepWindowOpen)
|
||||
call bookmark.toRoot()
|
||||
else
|
||||
if bookmark.validate()
|
||||
call (s:TreeFileNode.New(bookmark.path)).open()
|
||||
let n = s:TreeFileNode.New(bookmark.path)
|
||||
call n.open()
|
||||
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: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:NERDTreeMapPreviewSplit ." :call <SID>previewNode(1)<cr>"
|
||||
|
||||
Reference in New Issue
Block a user