mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b1f5bb60df | ||
|
|
32168889bd | ||
|
|
aedd0653ad | ||
|
|
1f2e28d476 | ||
|
|
6895e5259e | ||
|
|
c46e12a886 | ||
|
|
fc85a6f07c | ||
|
|
eed488b1cd | ||
|
|
9310f91476 | ||
|
|
e731b84559 |
4
.github/workflows/vint.yml
vendored
4
.github/workflows/vint.yml
vendored
@@ -7,9 +7,9 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@master
|
||||
uses: actions/checkout@v3
|
||||
- name: Run vint with reviewdog
|
||||
uses: reviewdog/action-vint@v1.0.1
|
||||
uses: reviewdog/action-vint@v1
|
||||
with:
|
||||
github_token: ${{ secrets.github_token }}
|
||||
reporter: github-pr-review
|
||||
|
||||
18
CHANGELOG.md
18
CHANGELOG.md
@@ -3,9 +3,25 @@
|
||||
PATCH versions are listed from newest to oldest under their respective MAJOR.MINOR
|
||||
version in an unordered list. The format is:
|
||||
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
|
||||
or
|
||||
- **.PATCH**:
|
||||
- Pull Request Title 1 (PR Author) [PR Number](Link to PR)
|
||||
- Pull Request Title 2 (PR Author) [PR Number](Link to PR)
|
||||
.
|
||||
.
|
||||
.
|
||||
- Pull Request Title n (PR Author) [PR Number](Link to PR)
|
||||
-->
|
||||
#### 7.0
|
||||
- **.0**:
|
||||
- Now we warn about invalid files instead of ignoring them silently. (rmonico) [#1365](https://github.com/preservim/nerdtree/pull/1365)
|
||||
- New g:NERDTreeWinPos options for top and bottom. (rzvxa) [#1363](https://github.com/preservim/nerdtree/pull/1363)
|
||||
- Fix error in README. (nickspoons) [#1330](https://github.com/preservim/nerdtree/pull/1330)
|
||||
- Fix typo in the documentation. (chapeupreto) [#1306](https://github.com/preservim/nerdtree/pull/1306)
|
||||
#### 6.10
|
||||
- **.14**: Replace trim() with a version-compatible alternative. (PhilRunninger) [#1265](https://github.com/preservim/nerdtree/pull/1265)
|
||||
- **.16**: Fix documentation errors. (lifecrisis) [#1269](https://github.com/preservim/nerdtree/pull/1269)
|
||||
- **.15**: Ensure backward compatible testing of types. (lifecrisis) [#1266](https://github.com/preservim/nerdtree/pull/1266)
|
||||
- **.14**: Replace trim() with a version-compatible alternative. (PhilRunninger) [#1265](https://github.com/preservim/nerdtree/pull/1265)
|
||||
- **.13**: Change highlighting of bookmarks in the tree. (PhilRunninger) [#1261](https://github.com/preservim/nerdtree/pull/1261)
|
||||
- **.12**: Answer the question about accessing files over scp or ftp. (PhilRunninger) [#1259](https://github.com/preservim/nerdtree/pull/1259)
|
||||
- **.11**: Trim filenames created via the fs_menu (elanorigby) [#1243](https://github.com/preservim/nerdtree/pull/1243)
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||

|
||||
|
||||
**NERDTree** is on the lookout for a new maintainer. See [issue #1280](https://github.com/preservim/nerdtree/issues/1280) to submit your name for consideration.
|
||||
|
||||
---
|
||||
|
||||
# The NERDTree [](https://github.com/preservim/nerdtree/actions?workflow=Vint)
|
||||
|
||||
## Introduction
|
||||
@@ -84,7 +90,7 @@ vim -u NONE -c "helptags ~/.vim/pack/vendor/start/nerdtree/doc" -c q
|
||||
After installing NERDTree, the best way to learn it is to turn on the Quick Help. Open NERDTree with the `:NERDTree` command, and press `?` to turn on the Quick Help, which will show you all the mappings and commands available in the NERDTree. Of course, your most complete source of information is the documentation: `:help NERDTree`.
|
||||
|
||||
## NERDTree Plugins
|
||||
NERDTree can be extended with custom mappings and functions using its built-in API. The details of this API and are described in the included documentation. Several plugins have been written, and are available on Github for installation like any other plugin. The plugins in this list are maintained (or not) by their respective owners, and certain combinations may be incompatible.
|
||||
NERDTree can be extended with custom mappings and functions using its built-in API. The details of this API are described in the included documentation. Several plugins have been written, and are available on Github for installation like any other plugin. The plugins in this list are maintained (or not) by their respective owners, and certain combinations may be incompatible.
|
||||
|
||||
* [Xuyuanp/nerdtree-git-plugin](https://github.com/Xuyuanp/nerdtree-git-plugin): Shows Git status flags for files and folders in NERDTree.
|
||||
* [ryanoasis/vim-devicons](https://github.com/ryanoasis/vim-devicons): Adds filetype-specific icons to NERDTree files and folders,
|
||||
@@ -172,7 +178,7 @@ autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_
|
||||
|
||||
```vim
|
||||
" Open the existing NERDTree on each new tab.
|
||||
autocmd BufWinEnter * if getcmdwintype() == '' | silent NERDTreeMirror | endif
|
||||
autocmd BufWinEnter * if &buftype != 'quickfix' && getcmdwintype() == '' | silent NERDTreeMirror | endif
|
||||
```
|
||||
or change your NERDTree-launching shortcut key like so:
|
||||
```vim
|
||||
@@ -183,8 +189,8 @@ nnoremap <C-n> :NERDTreeMirror<CR>:NERDTreeFocus<CR>
|
||||
### How can I change the default arrows?
|
||||
|
||||
```vim
|
||||
let g:NERDTreeDirArrowExpandable = '▸'
|
||||
let g:NERDTreeDirArrowCollapsible = '▾'
|
||||
let g:NERDTreeDirArrowExpandable = '?'
|
||||
let g:NERDTreeDirArrowCollapsible = '?'
|
||||
```
|
||||
The preceding values are the non-Windows default arrow symbols. Setting these variables to empty strings will remove the arrows completely and shift the entire tree two character positions to the left. See `:h NERDTreeDirArrowExpandable` for more details.
|
||||
|
||||
|
||||
@@ -112,18 +112,18 @@ function! nerdtree#compareNodePaths(p1, p2) abort
|
||||
" Compare chunks upto common length.
|
||||
" If chunks have different type, the one which has
|
||||
" integer type is the lesser.
|
||||
if type(sortKey1[i]) ==# type(sortKey2[i])
|
||||
if type(sortKey1[i]) == type(sortKey2[i])
|
||||
if sortKey1[i] <# sortKey2[i]
|
||||
return - 1
|
||||
elseif sortKey1[i] ># sortKey2[i]
|
||||
return 1
|
||||
endif
|
||||
elseif type(sortKey1[i]) ==# v:t_number
|
||||
elseif type(sortKey1[i]) == type(0)
|
||||
return -1
|
||||
elseif type(sortKey2[i]) ==# v:t_number
|
||||
elseif type(sortKey2[i]) == type(0)
|
||||
return 1
|
||||
endif
|
||||
let i = i + 1
|
||||
let i += 1
|
||||
endwhile
|
||||
|
||||
" Keys are identical upto common length.
|
||||
|
||||
@@ -1128,7 +1128,7 @@ setting is used.
|
||||
|
||||
------------------------------------------------------------------------------
|
||||
*NERDTreeWinPos*
|
||||
Values: "left" or "right"
|
||||
Values: "left", "right", "top" or "bottom"
|
||||
Default: "left".
|
||||
|
||||
This setting is used to determine where NERDTree window is placed on the
|
||||
@@ -1138,6 +1138,13 @@ This setting makes it possible to use two different explorer plugins
|
||||
simultaneously. For example, you could have the taglist plugin on the left of
|
||||
the window and the NERDTree on the right.
|
||||
|
||||
When setting this variable to "top" or "bottom" make sure to also change the
|
||||
|NERDTreeWinSize| to a more reasonable size.
|
||||
|
||||
For example:
|
||||
>
|
||||
let g:NERDTreeWinSize = 15
|
||||
<
|
||||
------------------------------------------------------------------------------
|
||||
*NERDTreeWinSize*
|
||||
Values: a positive integer.
|
||||
@@ -1256,10 +1263,10 @@ responsible pull request: https://github.com/preservim/nerdtree/pull/868.
|
||||
The default value of this variable depends on the features compiled into your
|
||||
vim and the values of |NERDTreeDirArrowCollapsible| and
|
||||
|NERDTreeDirArrowExpandable|.
|
||||
* If your vim is compiled with the +conceal feature, it is the "\x07" (BELL)
|
||||
character, and it is hidden by setting 'conceallevel' to 3. If you use
|
||||
autocommands, make sure none of them change that setting in the NERDTree_*
|
||||
buffers.
|
||||
* If your vim is compiled with the +conceal feature, it is the "\x07"
|
||||
(BEL) character, and it is hidden by setting 'conceallevel' to 2. If you
|
||||
use autocommands, make sure none of them change that setting in the
|
||||
NERD_Tree_* buffers.
|
||||
* If your vim does NOT have the +conceal feature and you're using "\u00a0"
|
||||
(non-breaking space) to hide the directory arrows, "\u00b7" (middle dot)
|
||||
is used as the default delimiter.
|
||||
|
||||
@@ -182,16 +182,17 @@ endfunction
|
||||
" Initialize the NERDTree window. Open the window, size it properly, set all
|
||||
" local options, etc.
|
||||
function! s:Creator._createTreeWin()
|
||||
let l:splitLocation = g:NERDTreeWinPos ==# 'left' ? 'topleft ' : 'botright '
|
||||
let l:splitLocation = g:NERDTreeWinPos ==# 'left' || g:NERDTreeWinPos ==# 'top' ? 'topleft ' : 'botright '
|
||||
let l:splitDirection = g:NERDTreeWinPos ==# 'left' || g:NERDTreeWinPos ==# 'right' ? 'vertical' : ''
|
||||
let l:splitSize = g:NERDTreeWinSize
|
||||
|
||||
if !g:NERDTree.ExistsForTab()
|
||||
let t:NERDTreeBufName = self._nextBufferName()
|
||||
silent! execute l:splitLocation . 'vertical ' . l:splitSize . ' new'
|
||||
silent! execute l:splitLocation . l:splitDirection . ' ' . l:splitSize . ' new'
|
||||
silent! execute 'edit ' . t:NERDTreeBufName
|
||||
silent! execute 'vertical resize '. l:splitSize
|
||||
silent! execute l:splitDirection . ' resize '. l:splitSize
|
||||
else
|
||||
silent! execute l:splitLocation . 'vertical ' . l:splitSize . ' split'
|
||||
silent! execute l:splitLocation . l:splitDirection . ' ' . l:splitSize . ' split'
|
||||
silent! execute 'buffer ' . t:NERDTreeBufName
|
||||
endif
|
||||
|
||||
|
||||
@@ -421,6 +421,7 @@ function! s:TreeDirNode._initChildren(silent)
|
||||
endif
|
||||
|
||||
let invalidFilesFound = 0
|
||||
let invalidFiles = []
|
||||
for i in files
|
||||
try
|
||||
let path = g:NERDTreePath.New(i)
|
||||
@@ -428,6 +429,7 @@ function! s:TreeDirNode._initChildren(silent)
|
||||
call g:NERDTreePathNotifier.NotifyListeners('init', path, self.getNerdtree(), {})
|
||||
catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/
|
||||
let invalidFilesFound += 1
|
||||
let invalidFiles += [i]
|
||||
endtry
|
||||
endfor
|
||||
|
||||
@@ -437,7 +439,7 @@ function! s:TreeDirNode._initChildren(silent)
|
||||
call nerdtree#echo('')
|
||||
|
||||
if invalidFilesFound
|
||||
call nerdtree#echoWarning(invalidFilesFound . ' file(s) could not be loaded into the NERD tree')
|
||||
call nerdtree#echoWarning(invalidFilesFound . ' Invalid file(s): ' . join(invalidFiles, ', '))
|
||||
endif
|
||||
return self.getChildCount()
|
||||
endfunction
|
||||
@@ -564,6 +566,7 @@ function! s:TreeDirNode.refresh()
|
||||
let files = self._glob('*', 1) + self._glob('.*', 0)
|
||||
let newChildNodes = []
|
||||
let invalidFilesFound = 0
|
||||
let invalidFiles = []
|
||||
for i in files
|
||||
try
|
||||
"create a new path and see if it exists in this nodes children
|
||||
@@ -580,7 +583,8 @@ function! s:TreeDirNode.refresh()
|
||||
call add(newChildNodes, newNode)
|
||||
endif
|
||||
catch /^NERDTree.\(InvalidArguments\|InvalidFiletype\)Error/
|
||||
let invalidFilesFound = 1
|
||||
let invalidFilesFound += 1
|
||||
let invalidFiles += [i]
|
||||
endtry
|
||||
endfor
|
||||
|
||||
@@ -589,7 +593,7 @@ function! s:TreeDirNode.refresh()
|
||||
call self.sortChildren()
|
||||
|
||||
if invalidFilesFound
|
||||
call nerdtree#echoWarning('some files could not be loaded into the NERD tree')
|
||||
call nerdtree#echoWarning(invalidFilesFound . ' Invalid file(s): ' . join(invalidFiles, ', '))
|
||||
endif
|
||||
endif
|
||||
endfunction
|
||||
|
||||
Reference in New Issue
Block a user