mirror of
https://github.com/amix/vimrc
synced 2025-06-17 19:35:00 +08:00
Updated plugins
This commit is contained in:
@ -29,6 +29,11 @@ if has("gui_mac") || has("gui_macvim") || has("mac")
|
||||
call NERDTreeAddMenuItem({'text': '(q)uicklook the current node', 'shortcut': 'q', 'callback': 'NERDTreeQuickLook'})
|
||||
endif
|
||||
|
||||
if executable("xdg-open")
|
||||
call NERDTreeAddMenuItem({'text': '(r)eveal the current node in file manager', 'shortcut': 'r', 'callback': 'NERDTreeRevealFileLinux'})
|
||||
call NERDTreeAddMenuItem({'text': '(o)pen the current node with system editor', 'shortcut': 'o', 'callback': 'NERDTreeExecuteFileLinux'})
|
||||
endif
|
||||
|
||||
if g:NERDTreePath.CopyingSupported()
|
||||
call NERDTreeAddMenuItem({'text': '(c)opy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'})
|
||||
endif
|
||||
@ -153,6 +158,7 @@ function! NERDTreeMoveNode()
|
||||
let bufnum = bufnr("^".curNode.path.str()."$")
|
||||
|
||||
call curNode.rename(newNodePath)
|
||||
call b:NERDTree.root.refresh()
|
||||
call NERDTreeRender()
|
||||
|
||||
"if the node is open in a buffer, ask the user if they want to
|
||||
@ -175,7 +181,8 @@ function! NERDTreeDeleteNode()
|
||||
let currentNode = g:NERDTreeFileNode.GetSelected()
|
||||
let confirmed = 0
|
||||
|
||||
if currentNode.path.isDirectory && currentNode.getChildCount() > 0
|
||||
if currentNode.path.isDirectory && ((currentNode.isOpen && currentNode.getChildCount() > 0) ||
|
||||
\ (len(currentNode._glob('*', 1)) > 0))
|
||||
let choice =input("Delete the current node\n" .
|
||||
\ "==========================================================\n" .
|
||||
\ "STOP! Directory is not empty! To delete, type 'yes'\n" .
|
||||
@ -336,4 +343,22 @@ function! NERDTreeExecuteFile()
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" FUNCTION: NERDTreeRevealFileLinux() {{{1
|
||||
function! NERDTreeRevealFileLinux()
|
||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
||||
let parentnode = treenode.parent
|
||||
if parentnode != {}
|
||||
call system("xdg-open '" . parentnode.path.str() . "' &")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" FUNCTION: NERDTreeExecuteFileLinux() {{{1
|
||||
function! NERDTreeExecuteFileLinux()
|
||||
let treenode = g:NERDTreeFileNode.GetSelected()
|
||||
if treenode != {}
|
||||
call system("xdg-open '" . treenode.path.str() . "' &")
|
||||
endif
|
||||
endfunction
|
||||
|
||||
" vim: set sw=4 sts=4 et fdm=marker:
|
||||
|
||||
|
Reference in New Issue
Block a user