Skip to content

Fix the e key mapping to use netrw if desired #1031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Aug 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Change Log

#### 5.3...
- **.1**: Fix the `e` key mapping to use netrw if desired [#1031](https://github.com/scrooloose/nerdtree/pull/1031)
- **.0**: Add file extension and size to sorting capabilities [#1029](https://github.com/scrooloose/nerdtree/pull/1029)
#### 5.2...
- **.9**: Suppress events for intermediate window/tab/buffer changes [#1026](https://github.com/scrooloose/nerdtree/pull/1026)
Expand Down
1 change: 1 addition & 0 deletions autoload/nerdtree/ui_glue.vim
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ function! nerdtree#ui_glue#createDefaultBindings()
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenInTabSilent, 'scope': 'Bookmark', 'callback': s . 'openInNewTabSilent' })

call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenExpl, 'scope': "DirNode", 'callback': s."openExplorer" })
call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapOpenExpl, 'scope': "FileNode", 'callback': s."openExplorer" })

call NERDTreeAddKeyMap({ 'key': g:NERDTreeMapDeleteBookmark, 'scope': "Bookmark", 'callback': s."deleteBookmark" })
endfunction
Expand Down
3 changes: 2 additions & 1 deletion lib/nerdtree/tree_dir_node.vim
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ endfunction
" Open an explorer window for this node in the previous window. The explorer
" can be a NERDTree window or a netrw window.
function! s:TreeDirNode.openExplorer()
call self.open({'where': 'p'})
execute "wincmd p"
execute "edit ".self.path.str({'format':'Edit'})
endfunction

" FUNCTION: TreeDirNode.openInNewTab(options) {{{1
Expand Down
6 changes: 6 additions & 0 deletions lib/nerdtree/tree_file_node.vim
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,12 @@ function! s:TreeFileNode.openInNewTab(options)
call self.open(extend({'where': 't'}, a:options))
endfunction

" FUNCTION: TreeFileNode.openExplorer()
function! s:TreeFileNode.openExplorer()
execute "wincmd p"
execute "edit ".self.path.getParent().str({'format':'Edit'})
endfunction

" FUNCTION: TreeFileNode.putCursorHere(isJump, recurseUpward){{{1
" Places the cursor on the line number this node is rendered on
"
Expand Down