1
0
mirror of https://github.com/amix/vimrc synced 2025-06-17 19:35:00 +08:00

Updated plugins

This commit is contained in:
Amir Salihefendic
2019-08-22 17:36:17 +02:00
parent 6711ae6453
commit 3aefdbd21a
244 changed files with 9486 additions and 3395 deletions

View File

@ -37,6 +37,7 @@ endif
if g:NERDTreePath.CopyingSupported()
call NERDTreeAddMenuItem({'text': '(c)opy the current node', 'shortcut': 'c', 'callback': 'NERDTreeCopyNode'})
endif
call NERDTreeAddMenuItem({'text': (has("clipboard")?'copy (p)ath to clipboard':'print (p)ath to screen'), 'shortcut': 'p', 'callback': 'NERDTreeCopyPath'})
if has("unix") || has("osx")
call NERDTreeAddMenuItem({'text': '(l)ist the current node', 'shortcut': 'l', 'callback': 'NERDTreeListNode'})
@ -113,14 +114,14 @@ function! s:promptToDelBuffer(bufnum, msg)
let l:listedBufferCount = 0
endif
if l:listedBufferCount > 1
exec "tabdo windo if winbufnr(0) == " . a:bufnum . " | exec ':bnext! ' | endif"
call nerdtree#exec("tabdo windo if winbufnr(0) == " . a:bufnum . " | exec ':bnext! ' | endif", 1)
else
exec "tabdo windo if winbufnr(0) == " . a:bufnum . " | exec ':enew! ' | endif"
call nerdtree#exec("tabdo windo if winbufnr(0) == " . a:bufnum . " | exec ':enew! ' | endif", 1)
endif
exec "tabnext " . s:originalTabNumber
exec s:originalWindowNumber . "wincmd w"
call nerdtree#exec("tabnext " . s:originalTabNumber, 1)
call nerdtree#exec(s:originalWindowNumber . "wincmd w", 1)
" 3. We don't need a previous buffer anymore
exec "bwipeout! " . a:bufnum
call nerdtree#exec("bwipeout! " . a:bufnum, 0)
endif
endfunction
@ -140,17 +141,17 @@ function! s:renameBuffer(bufNum, newNodeName, isDirectory)
let editStr = g:NERDTreePath.New(a:newNodeName).str({'format': 'Edit'})
endif
" 1. ensure that a new buffer is loaded
exec "badd " . quotedFileName
call nerdtree#exec("badd " . quotedFileName, 1)
" 2. ensure that all windows which display the just deleted filename
" display a buffer for a new filename.
let s:originalTabNumber = tabpagenr()
let s:originalWindowNumber = winnr()
exec "tabdo windo if winbufnr(0) == " . a:bufNum . " | exec ':e! " . editStr . "' | endif"
exec "tabnext " . s:originalTabNumber
exec s:originalWindowNumber . "wincmd w"
call nerdtree#exec("tabdo windo if winbufnr(0) == " . a:bufNum . " | exec ':e! " . editStr . "' | endif", 1)
call nerdtree#exec("tabnext " . s:originalTabNumber, 1)
call nerdtree#exec(s:originalWindowNumber . "wincmd w", 1)
" 3. We don't need a previous buffer anymore
try
exec "confirm bwipeout " . a:bufNum
call nerdtree#exec("confirm bwipeout " . a:bufNum, 0)
catch
" This happens when answering Cancel if confirmation is needed. Do nothing.
endtry
@ -364,6 +365,17 @@ function! NERDTreeCopyNode()
redraw!
endfunction
" FUNCTION: NERDTreeCopyPath() {{{1
function! NERDTreeCopyPath()
let l:nodePath = g:NERDTreeFileNode.GetSelected().path.str()
if has("clipboard")
let @* = l:nodePath
call nerdtree#echo("The path [" . l:nodePath . "] was copied to your clipboard.")
else
call nerdtree#echo("The full path is: " . l:nodePath)
endif
endfunction
" FUNCTION: NERDTreeQuickLook() {{{1
function! NERDTreeQuickLook()
let treenode = g:NERDTreeFileNode.GetSelected()