mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 03:43:50 -05:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d3becd1149 | ||
|
|
1b19089917 | ||
|
|
c8be9458dd |
@@ -5,6 +5,9 @@
|
|||||||
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
|
- **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR)
|
||||||
-->
|
-->
|
||||||
#### 6.10
|
#### 6.10
|
||||||
|
- **.4**: Removed directory separator from sort key (Daniel E) [#1219](https://github.com/preservim/nerdtree/pull/1219)
|
||||||
|
- **.3**: Add new FAQ and answer: How to prevent buffers replacing NERDTree. (PhilRunninger) [#1215](https://github.com/preservim/nerdtree/pull/1215)
|
||||||
|
- **.2**: New menu command: Run a system command in this directory. (PhilRunninger) [#1214](https://github.com/preservim/nerdtree/pull/1214)
|
||||||
- **.1**: Escape quotation marks so they can be used in key mappings. (PhilRunninger) [#1213](https://github.com/preservim/nerdtree/pull/1213)
|
- **.1**: Escape quotation marks so they can be used in key mappings. (PhilRunninger) [#1213](https://github.com/preservim/nerdtree/pull/1213)
|
||||||
- **.0**: Enable full path specifications for NERDTreeIgnore (PhilRunninger) [#1207](https://github.com/preservim/nerdtree/pull/1207)
|
- **.0**: Enable full path specifications for NERDTreeIgnore (PhilRunninger) [#1207](https://github.com/preservim/nerdtree/pull/1207)
|
||||||
#### 6.9
|
#### 6.9
|
||||||
|
|||||||
@@ -156,6 +156,14 @@ autocmd BufEnter * if tabpagenr('$') == 1 && winnr('$') == 1 && exists('b:NERDTr
|
|||||||
\ quit | endif
|
\ quit | endif
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### How can I prevent other buffers replacing NERDTree in its window?
|
||||||
|
|
||||||
|
```vim
|
||||||
|
" If another buffer tries to replace NERDTree, put in the other window, and bring back NERDTree.
|
||||||
|
autocmd BufEnter * if bufname('#') =~ 'NERD_tree_\d\+' && bufname('%') !~ 'NERD_tree_\d\+' && winnr('$') > 1 |
|
||||||
|
\ let buf=bufnr() | buffer# | execute "normal! \<C-W>w" | execute 'buffer'.buf | endif
|
||||||
|
```
|
||||||
|
|
||||||
### Can I have the same NERDTree on every tab automatically?
|
### Can I have the same NERDTree on every tab automatically?
|
||||||
|
|
||||||
```vim
|
```vim
|
||||||
|
|||||||
@@ -394,7 +394,7 @@ function! s:Path.getSortKey()
|
|||||||
let self._sortKey = [self.getSortOrderIndex()] + metadata
|
let self._sortKey = [self.getSortOrderIndex()] + metadata
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let path = self.getLastPathComponent(1)
|
let path = self.getLastPathComponent(0)
|
||||||
if !g:NERDTreeSortHiddenFirst
|
if !g:NERDTreeSortHiddenFirst
|
||||||
let path = substitute(path, '^[._]', '', '')
|
let path = substitute(path, '^[._]', '', '')
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -49,6 +49,10 @@ else
|
|||||||
call NERDTreeAddMenuItem({'text': '(l)ist the current node', 'shortcut': 'l', 'callback': 'NERDTreeListNodeWin32'})
|
call NERDTreeAddMenuItem({'text': '(l)ist the current node', 'shortcut': 'l', 'callback': 'NERDTreeListNodeWin32'})
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if exists('*system')
|
||||||
|
call NERDTreeAddMenuItem({'text': 'Run (s)ystem command in this directory', 'shortcut':'s', 'callback': 'NERDTreeSystemCommand'})
|
||||||
|
endif
|
||||||
|
|
||||||
"FUNCTION: s:inputPrompt(action){{{1
|
"FUNCTION: s:inputPrompt(action){{{1
|
||||||
"returns the string that should be prompted to the user for the given action
|
"returns the string that should be prompted to the user for the given action
|
||||||
"
|
"
|
||||||
@@ -460,4 +464,21 @@ function! NERDTreeExecuteFileWindows()
|
|||||||
call system('cmd.exe /c start "" ' . shellescape(l:node.path.str()))
|
call system('cmd.exe /c start "" ' . shellescape(l:node.path.str()))
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" FUNCTION: NERDTreeSystemCommand() {{{1
|
||||||
|
function! NERDTreeSystemCommand()
|
||||||
|
let l:node = g:NERDTreeFileNode.GetSelected()
|
||||||
|
|
||||||
|
if empty(l:node)
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
let l:cwd = getcwd()
|
||||||
|
let l:directory = l:node.path.isDirectory ? l:node.path.str() : l:node.parent.path.str()
|
||||||
|
execute 'cd '.l:directory
|
||||||
|
|
||||||
|
let l:nl = nr2char(10)
|
||||||
|
echo l:nl . system(input(l:directory . (nerdtree#runningWindows() ? '> ' : ' $ ')))
|
||||||
|
execute 'cd '.l:cwd
|
||||||
|
endfunction
|
||||||
|
|
||||||
" vim: set sw=4 sts=4 et fdm=marker:
|
" vim: set sw=4 sts=4 et fdm=marker:
|
||||||
|
|||||||
Reference in New Issue
Block a user