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

Updated plugins

This commit is contained in:
amix
2014-07-02 12:18:18 +01:00
parent 6a16a9393c
commit 1dba960b75
156 changed files with 2657 additions and 1234 deletions

View File

@ -19,7 +19,9 @@ function! s:Bookmark.AddBookmark(name, path)
endif
endfor
call add(s:Bookmark.Bookmarks(), s:Bookmark.New(a:name, a:path))
call s:Bookmark.Sort()
if g:NERDTreeBookmarksSort ==# 1
call s:Bookmark.Sort()
endif
endfunction
" FUNCTION: Bookmark.Bookmarks() {{{1
@ -101,7 +103,9 @@ function! s:Bookmark.CacheBookmarks(silent)
call nerdtree#echo(invalidBookmarksFound . " invalid bookmarks were read. See :help NERDTreeInvalidBookmarks for info.")
endif
endif
call s:Bookmark.Sort()
if g:NERDTreeBookmarksSort ==# 1
call s:Bookmark.Sort()
endif
endif
endfunction

View File

@ -279,8 +279,8 @@ function! s:Creator._setCommonBufOptions()
let b:NERDTreeShowFiles = g:NERDTreeShowFiles
let b:NERDTreeShowHidden = g:NERDTreeShowHidden
let b:NERDTreeShowBookmarks = g:NERDTreeShowBookmarks
setfiletype nerdtree
call self._bindMappings()
setlocal filetype=nerdtree
endfunction
"FUNCTION: s:Creator._setupStatusline() {{{1

View File

@ -90,7 +90,7 @@ endfunction
"callback
function! s:MenuItem.execute()
if len(self.children)
let mc = s:MenuController.New(self.children)
let mc = g:NERDTreeMenuController.New(self.children)
call mc.showMenu()
else
if self.callback != -1

View File

@ -103,6 +103,10 @@ function! s:Path.compareTo(path)
elseif thisSS > thatSS
return 1
else
if !g:NERDTreeSortHiddenFirst
let thisPath = substitute(thisPath, '^[._]', '', '')
let thatPath = substitute(thatPath, '^[._]', '', '')
endif
"if the sort sequences are the same then compare the paths
"alphabetically
let pathCompare = g:NERDTreeCaseSensitiveSort ? thisPath <# thatPath : thisPath <? thatPath
@ -141,6 +145,7 @@ function! s:Path.Create(fullpath)
"assume its a file and create
else
call s:Path.createParentDirectories(a:fullpath)
call writefile([], a:fullpath)
endif
catch
@ -161,6 +166,8 @@ function! s:Path.copy(dest)
throw "NERDTree.CopyingNotSupportedError: Copying is not supported on this OS"
endif
call s:Path.createParentDirectories(a:dest)
let dest = s:Path.WinToUnixPath(a:dest)
let cmd = g:NERDTreeCopyCmd . " " . escape(self.str(), nerdtree#escChars()) . " " . escape(dest, nerdtree#escChars())
@ -197,6 +204,20 @@ function! s:Path.copyingWillOverwrite(dest)
endif
endfunction
"FUNCTION: Path.createParentDirectories(path) {{{1
"
"create parent directories for this path if needed
"without throwing any errors is those directories already exist
"
"Args:
"path: full path of the node whose parent directories may need to be created
function! s:Path.createParentDirectories(path)
let dir_path = fnamemodify(a:path, ':h')
if !isdirectory(dir_path)
call mkdir(dir_path, 'p')
endif
endfunction
"FUNCTION: Path.delete() {{{1
"
"Deletes the file represented by this path.

View File

@ -229,7 +229,7 @@ function! s:TreeDirNode._initChildren(silent)
let globDir = dir.str({'format': 'Glob'})
if version >= 703
let filesStr = globpath(globDir, '*', 1) . "\n" . globpath(globDir, '.*', 1)
let filesStr = globpath(globDir, '*', !g:NERDTreeRespectWildIgnore) . "\n" . globpath(globDir, '.*', !g:NERDTreeRespectWildIgnore)
else
let filesStr = globpath(globDir, '*') . "\n" . globpath(globDir, '.*')
endif
@ -500,7 +500,7 @@ function! s:TreeDirNode.toggleOpen(...)
if self.isOpen ==# 1
call self.close()
else
if g:NERDTreeCasadeOpenSingleChildDir == 0
if g:NERDTreeCascadeOpenSingleChildDir == 0
call self.open(opts)
else
call self.openAlong(opts)