mirror of
https://github.com/amix/vimrc
synced 2025-06-16 09:35:01 +08:00
Updated vim plugins
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@ -33,7 +33,7 @@ function! s:Creator._broadcastInitEvent()
|
||||
silent doautocmd User NERDTreeInit
|
||||
endfunction
|
||||
|
||||
" FUNCTION: s:Creator.BufNamePrefix() {{{2
|
||||
" FUNCTION: s:Creator.BufNamePrefix() {{{1
|
||||
function! s:Creator.BufNamePrefix()
|
||||
return 'NERD_tree_'
|
||||
endfunction
|
||||
|
@ -49,7 +49,7 @@ endfunction
|
||||
|
||||
"FUNCTION: MenuController._echoPrompt() {{{1
|
||||
function! s:MenuController._echoPrompt()
|
||||
echo "NERDTree Menu. Use j/k/enter and the shortcuts indicated"
|
||||
echo "NERDTree Menu. Use " . g:NERDTreeMenuDown . "/" . g:NERDTreeMenuUp . "/enter and the shortcuts indicated"
|
||||
echo "=========================================================="
|
||||
|
||||
for i in range(0, len(self.menuItems)-1)
|
||||
@ -71,9 +71,9 @@ endfunction
|
||||
"change the selection (if appropriate) and return 1 if the user has made
|
||||
"their choice, 0 otherwise
|
||||
function! s:MenuController._handleKeypress(key)
|
||||
if a:key == 'j'
|
||||
if a:key == g:NERDTreeMenuDown
|
||||
call self._cursorDown()
|
||||
elseif a:key == 'k'
|
||||
elseif a:key == g:NERDTreeMenuUp
|
||||
call self._cursorUp()
|
||||
elseif a:key == nr2char(27) "escape
|
||||
let self.selection = -1
|
||||
|
@ -254,6 +254,13 @@ function! s:TreeDirNode.getChildIndex(path)
|
||||
return -1
|
||||
endfunction
|
||||
|
||||
" FUNCTION: TreeDirNode.getDirChildren() {{{1
|
||||
" Return a list of all child nodes from "self.children" that are of type
|
||||
" TreeDirNode. This function supports http://github.com/scrooloose/nerdtree-project-plugin.git.
|
||||
function! s:TreeDirNode.getDirChildren()
|
||||
return filter(copy(self.children), 'v:val.path.isDirectory == 1')
|
||||
endfunction
|
||||
|
||||
" FUNCTION: TreeDirNode._glob(pattern, all) {{{1
|
||||
" Return a list of strings naming the descendants of the directory in this
|
||||
" TreeDirNode object that match the specified glob pattern.
|
||||
@ -370,12 +377,26 @@ function! s:TreeDirNode.hasVisibleChildren()
|
||||
endfunction
|
||||
|
||||
" FUNCTION: TreeDirNode.isCascadable() {{{1
|
||||
" true if this dir has only one visible child - which is also a dir
|
||||
" true if this dir has only one visible child that is also a dir
|
||||
" false if this dir is bookmarked or symlinked. Why? Two reasons:
|
||||
" 1. If cascaded, we don't know which dir is bookmarked or is a symlink.
|
||||
" 2. If the parent is a symlink or is bookmarked, you end up with unparsable
|
||||
" text, and NERDTree cannot get the path of any child node.
|
||||
function! s:TreeDirNode.isCascadable()
|
||||
if g:NERDTreeCascadeSingleChildDir == 0
|
||||
return 0
|
||||
endif
|
||||
|
||||
if self.path.isSymLink
|
||||
return 0
|
||||
endif
|
||||
|
||||
for i in g:NERDTreeBookmark.Bookmarks()
|
||||
if i.path.equals(self.path)
|
||||
return 0
|
||||
endif
|
||||
endfor
|
||||
|
||||
let c = self.getVisibleChildren()
|
||||
return len(c) == 1 && c[0].path.isDirectory
|
||||
endfunction
|
||||
|
@ -86,8 +86,8 @@ let g:NERDTreeOldSortOrder = []
|
||||
|
||||
call s:initVariable("g:NERDTreeGlyphReadOnly", "RO")
|
||||
|
||||
" ASCII 160: non-breaking space used to delimit items in the tree's nodes.
|
||||
call s:initVariable("g:NERDTreeNodeDelimiter", "\u00a0")
|
||||
" ASCII 7: bell non-printing character used to delimit items in the tree's nodes.
|
||||
call s:initVariable("g:NERDTreeNodeDelimiter", "\x07")
|
||||
|
||||
if !exists('g:NERDTreeStatusline')
|
||||
|
||||
@ -148,6 +148,8 @@ call s:initVariable("g:NERDTreeMapToggleZoom", "A")
|
||||
call s:initVariable("g:NERDTreeMapUpdir", "u")
|
||||
call s:initVariable("g:NERDTreeMapUpdirKeepOpen", "U")
|
||||
call s:initVariable("g:NERDTreeMapCWD", "CD")
|
||||
call s:initVariable("g:NERDTreeMenuDown", "j")
|
||||
call s:initVariable("g:NERDTreeMenuUp", "k")
|
||||
|
||||
"SECTION: Load class files{{{2
|
||||
call nerdtree#loadClassFiles()
|
||||
|
@ -33,15 +33,15 @@ exec 'syn match NERDTreeFile #^[^"\.'.s:dirArrows.'] *[^'.s:dirArrows.']*# cont
|
||||
"highlighting for readonly files
|
||||
exec 'syn match NERDTreeRO # *\zs.*\ze \['.g:NERDTreeGlyphReadOnly.'\]# contains=NERDTreeIgnore,NERDTreeBookmark,NERDTreeFile'
|
||||
|
||||
syn match NERDTreeFlags #^ *\zs\[.\]# containedin=NERDTreeFile,NERDTreeExecFile
|
||||
syn match NERDTreeFlags #\[.\]# containedin=NERDTreeDir
|
||||
syn match NERDTreeFlags #^ *\zs\[[^\]]*\]# containedin=NERDTreeFile,NERDTreeExecFile
|
||||
syn match NERDTreeFlags #\[[^\]]*\]# containedin=NERDTreeDir
|
||||
|
||||
"highlighing to conceal the delimiter around the file/dir name
|
||||
if has("conceal")
|
||||
exec 'syn match NERDTreeNodeDelimiters #' . g:NERDTreeNodeDelimiter . '# conceal containedin=NERDTreeFile,NERDTreeLinkFile,NERDTreeExecFile,NERDTreeRO,NERDTreeDir'
|
||||
exec 'syn match NERDTreeNodeDelimiters #\%d' . char2nr(g:NERDTreeNodeDelimiter) . '# conceal containedin=ALL'
|
||||
setlocal conceallevel=3 concealcursor=nvic
|
||||
else
|
||||
exec 'syn match NERDTreeNodeDelimiters #' . g:NERDTreeNodeDelimiter . '# containedin=NERDTreeFile,NERDTreeLinkFile,NERDTreeExecFile,NERDTreeRO,NERDTreeDir'
|
||||
exec 'syn match NERDTreeNodeDelimiters #\%d' . char2nr(g:NERDTreeNodeDelimiter) . '# containedin=ALL'
|
||||
hi! link NERDTreeNodeDelimiters Ignore
|
||||
endif
|
||||
|
||||
|
Reference in New Issue
Block a user