hi link treePartFile treeDirSlash
" Fix up BufExplorer stuff.
- hi link bufExplorerHelp String
- hi link bufExplorerSortBy Statement
+ hi link bufExplorerHelp Include
+ hi link bufExplorerSortBy Include
hi link bufExplorerMapping Identifier
hi link bufExplorerTitle Statement
hi link bufExplorerActBuf Directory
- hi link bufExplorerAltBuf String
- hi link bufExplorerCurBuf Type
- hi link bufExplorerUnlBuf Comment
+ hi link bufExplorerAltBuf Type
+ hi link bufExplorerCurBuf Statement
+ hi link bufExplorerHidBuf Comment
+ hi link bufExplorerUnlBuf String
hi link bufExplorerBufNbr Normal
endif
endif
endfun "}}}2
+" Handle searching in a BufExplorer window.
+fun! <SID>BufExplorer_Search(n) "{{{2
+ if a:n == 0
+ let l:re = '^ *\d %'
+ else
+ let l:re = "^ *" . a:n
+ endif
+
+ " Find matching line.
+ let l:line = search(l:re, 'w')
+ if ! l:line
+ return
+ endif
+
+ if a:n == 0
+ return
+ endif
+
+ " Peek ahead to the next matching line.
+ let l:next = search(l:re, 'w')
+
+ " Select the buffer if the match is unambiguous.
+ if l:next == l:line
+ exe "normal \<CR>"
+ return
+ endif
+
+ " Go back.
+ call cursor(l:line, 0)
+endfun! "}}}2
+
+" Entering a BufExplorer window.
+fun! <SID>BufExplorer_Map() "{{{2
+ for l:n in [ "0", "1", "2", "3", "4", "5", "6", "7", "8", "9" ]
+ exec "nnoremap <buffer> <silent>" . l:n . " :call <SID>BufExplorer_Search(" . l:n . ")<CR>"
+ endfor
+endfun "}}}2
+
if has("windows")
se tabline=%!Show_TabLine()
se guitablabel=%!Show_GUITabLine()
au Signs InsertEnter * call <SID>Highlight_Signs()
au Signs InsertLeave * call <SID>Highlight_Signs()
endif
+
+ au Mode BufEnter \[BufExplorer\] call <SID>BufExplorer_Map()
endif
" Limit the size of the popup menu when completing.