From 607cc29d816ef0b4c09c0ce3dc185c71835eca07 Mon Sep 17 00:00:00 2001 From: Kien N Date: Tue, 13 Mar 2012 16:20:56 +0700 Subject: [PATCH] Add some highlight groups --- autoload/ctrlp.vim | 2 +- autoload/ctrlp/buffertag.vim | 20 ++++++++++++++++---- doc/ctrlp.txt | 18 +++++++++++------- 3 files changed, 28 insertions(+), 12 deletions(-) diff --git a/autoload/ctrlp.vim b/autoload/ctrlp.vim index 03068f0..972d4aa 100644 --- a/autoload/ctrlp.vim +++ b/autoload/ctrlp.vim @@ -2,7 +2,7 @@ " File: autoload/ctrlp.vim " Description: Fuzzy file, buffer, mru and tag finder. " Author: Kien Nguyen -" Version: 1.7.2 +" Version: 1.7.3 " ============================================================================= " Static variables {{{1 diff --git a/autoload/ctrlp/buffertag.vim b/autoload/ctrlp/buffertag.vim index 345f876..0092c75 100644 --- a/autoload/ctrlp/buffertag.vim +++ b/autoload/ctrlp/buffertag.vim @@ -196,6 +196,21 @@ fu! s:parseline(line) let [bufnr, bufname] = [bufnr('^'.vals[2].'$'), fnamemodify(vals[2], ':p:t')] retu vals[1].' '.vals[4].'|'.bufnr.':'.bufname.'|'.vals[6].'| '.vals[3] endf + +fu! s:syntax() + if !hlexists('CtrlPTagKind') + hi link CtrlPTagKind Title + en + if !hlexists('CtrlPBufName') + hi link CtrlPBufName Directory + en + if !hlexists('CtrlPTabExtra') + hi link CtrlPTabExtra Comment + en + sy match CtrlPTagKind '\zs[^\t|]\+\ze|\d\+:[^|]\+|\d\+|' + sy match CtrlPBufName '|\d\+:\zs[^|]\+\ze|\d\+|' + sy match CtrlPTabExtra '\zs\t.*\ze$' contains=CtrlPBufName,CtrlPTagKind +endf " Public {{{1 fu! ctrlp#buffertag#init(fname) let bufs = exists('s:btmode') && s:btmode @@ -207,10 +222,7 @@ fu! ctrlp#buffertag#init(fname) cal extend(lines, s:process(each, tftype)) endfo if has('syntax') && exists('g:syntax_on') - if !hlexists('CtrlPTabExtra') - hi link CtrlPTabExtra Comment - en - sy match CtrlPTabExtra '\zs\t.*\ze$' + cal s:syntax() en retu lines endf diff --git a/doc/ctrlp.txt b/doc/ctrlp.txt index 1917b6f..64fd8a5 100644 --- a/doc/ctrlp.txt +++ b/doc/ctrlp.txt @@ -1,4 +1,4 @@ -*ctrlp.txt* Fuzzy file, buffer, mru and tag finder. v1.7.2 +*ctrlp.txt* Fuzzy file, buffer, mru and tag finder. v1.7.3 *CtrlP* *ControlP* *'ctrlp'* *'ctrl-p'* =============================================================================== # # @@ -408,7 +408,7 @@ Structure of the functions: > function! Function_Name_2(str) " a:str " | - " + Either a number of files scanned so far, or a string indicating the + " + Either the number of files scanned so far, or a string indicating the " directory is being scanned with a user_command. return full_statusline @@ -736,7 +736,7 @@ Available extensions:~ * Line mode:~ - Name: 'line' - Command: ':CtrlPLine' - - Search for a line in all listed buffer. + - Search for a line in all listed buffers. *:CtrlPChange* *:CtrlPChangeAll* @@ -789,10 +789,14 @@ Highlighting:~ * In extensions: CtrlPTabExtra : the part of each line that’s not matched against (Comment) - CtrlPqfLineCol : the line and column numbers in quickfix mode (|hl-Search|) - CtrlPUndoT : the elapsed time in undo mode (|hl-Directory|) - CtrlPUndoBr : the square brackets [] in undo mode (Comment) - CtrlPUndoNr : the undo number inside [] in undo mode (String) + CtrlPBufName : the buffer name an entry belongs to (|hl-Directory|) + CtrlPTagKind : the kind of the tag in buffer-tag mode (|hl-Title|) + CtrlPqfLineCol : the line and column numbers in quickfix mode (Comment) + CtrlPUndoT : the elapsed time in undo mode (|hl-Directory|) + CtrlPUndoBr : the square brackets [] in undo mode (Comment) + CtrlPUndoNr : the undo number inside [] in undo mode (String) + CtrlPUndoSv : the point where the file was saved (Comment) + CtrlPUndoPo : the current position in the undo tree (|hl-Title|) Statuslines:~ * Highlight groups: