mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 11:53:48 -05:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c8be9458dd | ||
|
|
628098fff1 |
@@ -5,6 +5,8 @@
|
|||||||
- **.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
|
||||||
|
- **.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)
|
||||||
- **.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
|
||||||
- **.12**: Respect NERDTreeCustomOpenArgs when opening bookmark (przepompownia) [#1200](https://github.com/preservim/nerdtree/pull/1200)
|
- **.12**: Respect NERDTreeCustomOpenArgs when opening bookmark (przepompownia) [#1200](https://github.com/preservim/nerdtree/pull/1200)
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ function! s:KeyMap.bind()
|
|||||||
else
|
else
|
||||||
let keymapInvokeString = self.key
|
let keymapInvokeString = self.key
|
||||||
endif
|
endif
|
||||||
let keymapInvokeString = escape(keymapInvokeString, '\')
|
let keymapInvokeString = escape(keymapInvokeString, '\"')
|
||||||
|
|
||||||
let premap = self.key ==# '<LeftRelease>' ? ' <LeftRelease>' : ' '
|
let premap = self.key ==# '<LeftRelease>' ? ' <LeftRelease>' : ' '
|
||||||
|
|
||||||
|
|||||||
@@ -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