diff --git a/CHANGELOG.md b/CHANGELOG.md index 95c290f..30f4758 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - **.PATCH**: Pull Request Title (PR Author) [PR Number](Link to PR) --> #### 6.7 +- **.13**: Invoke-Item for windows default viewer support. (J. AltayĆ³) [#1130](https://github.com/preservim/nerdtree/pull/1130) - **.12**: Fixed a bug that caused the file-tree construction to slow down significantly. [#1126](https://github.com/preservim/nerdtree/pull/1126) - **.11**: Fix exception in NERDTreeFind (on windows OS and If the file is located in the root directory of the disk) [#1122](https://github.com/preservim/nerdtree/pull/1122) - **.10**: Do not consider the tree root to be "cascadable". (lifecrisis) [#1120](https://github.com/preservim/nerdtree/pull/1120) diff --git a/nerdtree_plugin/fs_menu.vim b/nerdtree_plugin/fs_menu.vim index 9750976..3073414 100644 --- a/nerdtree_plugin/fs_menu.vim +++ b/nerdtree_plugin/fs_menu.vim @@ -34,6 +34,10 @@ if executable('xdg-open') call NERDTreeAddMenuItem({'text': '(o)pen the current node with system editor', 'shortcut': 'o', 'callback': 'NERDTreeExecuteFileLinux'}) endif +if nerdtree#runningWindows() + call NERDTreeAddMenuItem({'text': '(o)pen the current node with system editor', 'shortcut': 'o', 'callback': 'NERDTreeExecuteFileWindows'}) +endif + if g:NERDTreePath.CopyingSupported() call NERDTreeAddMenuItem({'text': '(c)opy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'}) endif @@ -451,4 +455,15 @@ function! NERDTreeExecuteFileLinux() call system('xdg-open ' . shellescape(l:node.path.str())) endfunction +" FUNCTION: NERDTreeExecuteFileWindows() {{{1 +function! NERDTreeExecuteFileWindows() + let l:node = g:NERDTreeFileNode.GetSelected() + + if empty(l:node) + return + endif + + call system('cmd.exe /c start "" ' . shellescape(l:node.path.str())) +endfunction + " vim: set sw=4 sts=4 et fdm=marker: