mirror of
https://github.com/gryf/.vim.git
synced 2025-12-18 03:50:30 +01:00
Update of plugins: mark, ctrlp, taglisttoo and syntastic
This commit is contained in:
@@ -7,7 +7,7 @@ ScriptID SourceID Filename
|
|||||||
3304 17406 gundo.vim
|
3304 17406 gundo.vim
|
||||||
2727 11120 jsbeautify.vim
|
2727 11120 jsbeautify.vim
|
||||||
2289 8922 loremipsum
|
2289 8922 loremipsum
|
||||||
2666 17661 Mark
|
2666 17666 Mark
|
||||||
1218 14455 nerdcommenter
|
1218 14455 nerdcommenter
|
||||||
2262 8944 occur.vim
|
2262 8944 occur.vim
|
||||||
2136 8206 repeat.vim
|
2136 8206 repeat.vim
|
||||||
@@ -20,7 +20,7 @@ ScriptID SourceID Filename
|
|||||||
1334 6377 vst.vim
|
1334 6377 vst.vim
|
||||||
2321 9055 zoom.vim
|
2321 9055 zoom.vim
|
||||||
52 14880 calendar.vim
|
52 14880 calendar.vim
|
||||||
3736 17319 ctrlp.vim
|
3736 17669 ctrlp.vim
|
||||||
### ftplugin
|
### ftplugin
|
||||||
3818 16921 MatchTag
|
3818 16921 MatchTag
|
||||||
910 14691 pydoc.vim
|
910 14691 pydoc.vim
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ fu! s:opts()
|
|||||||
\ 'g:ctrlp_by_filename': ['s:byfname', 0],
|
\ 'g:ctrlp_by_filename': ['s:byfname', 0],
|
||||||
\ 'g:ctrlp_clear_cache_on_exit': ['s:clrex', 1],
|
\ 'g:ctrlp_clear_cache_on_exit': ['s:clrex', 1],
|
||||||
\ 'g:ctrlp_custom_ignore': ['s:usrign', ''],
|
\ 'g:ctrlp_custom_ignore': ['s:usrign', ''],
|
||||||
|
\ 'g:ctrlp_default_input': ['s:deftxt', 0],
|
||||||
\ 'g:ctrlp_dont_split': ['s:nosplit', 'netrw'],
|
\ 'g:ctrlp_dont_split': ['s:nosplit', 'netrw'],
|
||||||
\ 'g:ctrlp_dotfiles': ['s:dotfiles', 1],
|
\ 'g:ctrlp_dotfiles': ['s:dotfiles', 1],
|
||||||
\ 'g:ctrlp_extensions': ['s:extensions', []],
|
\ 'g:ctrlp_extensions': ['s:extensions', []],
|
||||||
@@ -58,7 +59,6 @@ fu! s:opts()
|
|||||||
let s:glob = s:dotfiles ? '.*\|*' : '*'
|
let s:glob = s:dotfiles ? '.*\|*' : '*'
|
||||||
let s:igntype = empty(s:usrign) ? -1 : type(s:usrign)
|
let s:igntype = empty(s:usrign) ? -1 : type(s:usrign)
|
||||||
" Extensions
|
" Extensions
|
||||||
let g:ctrlp_builtins = 2
|
|
||||||
for each in s:extensions
|
for each in s:extensions
|
||||||
exe 'ru autoload/ctrlp/'.each.'.vim'
|
exe 'ru autoload/ctrlp/'.each.'.vim'
|
||||||
endfo
|
endfo
|
||||||
@@ -173,6 +173,7 @@ let s:hlgrps = {
|
|||||||
fu! s:Open()
|
fu! s:Open()
|
||||||
cal s:log(1)
|
cal s:log(1)
|
||||||
cal s:getenv()
|
cal s:getenv()
|
||||||
|
cal s:execextvar('enter')
|
||||||
sil! exe 'noa keepa' ( s:mwbottom ? 'bo' : 'to' ) '1new ControlP'
|
sil! exe 'noa keepa' ( s:mwbottom ? 'bo' : 'to' ) '1new ControlP'
|
||||||
let [s:bufnr, s:prompt, s:winw] = [bufnr('%'), ['', '', ''], winwidth(0)]
|
let [s:bufnr, s:prompt, s:winw] = [bufnr('%'), ['', '', ''], winwidth(0)]
|
||||||
abc <buffer>
|
abc <buffer>
|
||||||
@@ -204,7 +205,7 @@ fu! s:Close()
|
|||||||
unl! s:focus s:hisidx s:hstgot s:marked s:statypes s:cline s:init s:savestr
|
unl! s:focus s:hisidx s:hstgot s:marked s:statypes s:cline s:init s:savestr
|
||||||
\ g:ctrlp_nolimit
|
\ g:ctrlp_nolimit
|
||||||
cal ctrlp#recordhist()
|
cal ctrlp#recordhist()
|
||||||
cal s:extvar('exit')
|
cal s:execextvar('exit')
|
||||||
cal s:log(0)
|
cal s:log(0)
|
||||||
ec
|
ec
|
||||||
endf
|
endf
|
||||||
@@ -228,7 +229,7 @@ fu! ctrlp#reset()
|
|||||||
cal s:autocmds()
|
cal s:autocmds()
|
||||||
cal ctrlp#utils#opts()
|
cal ctrlp#utils#opts()
|
||||||
cal ctrlp#mrufiles#opts()
|
cal ctrlp#mrufiles#opts()
|
||||||
cal s:extvar('opts')
|
cal s:execextvar('opts')
|
||||||
endf
|
endf
|
||||||
" * Files {{{1
|
" * Files {{{1
|
||||||
fu! ctrlp#files()
|
fu! ctrlp#files()
|
||||||
@@ -318,16 +319,15 @@ fu! ctrlp#buffers()
|
|||||||
endf
|
endf
|
||||||
" * MatchedItems() {{{1
|
" * MatchedItems() {{{1
|
||||||
fu! s:MatchIt(items, pat, limit, mfunc, ipt, exc)
|
fu! s:MatchIt(items, pat, limit, mfunc, ipt, exc)
|
||||||
let [newitems, id, itlen] = [[], 0, len(a:items)]
|
let [newitems, id] = [[], 0]
|
||||||
wh id < itlen
|
for item in a:items
|
||||||
let item = a:items[id]
|
|
||||||
let id += 1
|
let id += 1
|
||||||
try | if !( a:ipt && item == a:exc ) && call(a:mfunc, [item, a:pat]) >= 0
|
try | if !( a:ipt && item == a:exc ) && call(a:mfunc, [item, a:pat]) >= 0
|
||||||
cal add(newitems, item)
|
cal add(newitems, item)
|
||||||
en | cat | brea | endt
|
en | cat | brea | endt
|
||||||
if a:limit > 0 && len(newitems) >= a:limit | brea | en
|
if a:limit > 0 && len(newitems) >= a:limit | brea | en
|
||||||
endw
|
endfo
|
||||||
let s:mdata = [s:dyncwd, s:itemtype, s:regexp, a:items[(id):]]
|
let s:mdata = [s:dyncwd, s:itemtype, s:regexp, s:sublist(a:items, id, -1)]
|
||||||
retu newitems
|
retu newitems
|
||||||
endf
|
endf
|
||||||
|
|
||||||
@@ -387,21 +387,22 @@ fu! s:Render(lines, pat, ipt)
|
|||||||
sil! exe '%d _ | res' s:height
|
sil! exe '%d _ | res' s:height
|
||||||
" Print the new items
|
" Print the new items
|
||||||
if empty(lines)
|
if empty(lines)
|
||||||
let s:matched = []
|
let [s:matched, s:lines] = [[], []]
|
||||||
cal setline(1, ' == NO ENTRIES ==')
|
cal setline(1, ' == NO ENTRIES ==')
|
||||||
setl noma nocul
|
setl noma nocul
|
||||||
cal s:unmarksigns()
|
cal s:unmarksigns()
|
||||||
if s:dohighlight() | cal clearmatches() | en
|
if s:dohighlight() | cal clearmatches() | en
|
||||||
retu
|
retu
|
||||||
en
|
en
|
||||||
if ( ( s:itemtype != 2 && !exists('g:ctrlp_nolimit') )
|
" Sorting
|
||||||
\ || s:prompt != ['', '', ''] ) && s:matcher == {}
|
if s:dosort()
|
||||||
let s:compat = a:pat
|
let s:compat = a:pat
|
||||||
cal sort(lines, 's:mixedsort')
|
cal sort(lines, 's:mixedsort')
|
||||||
unl s:compat
|
unl s:compat
|
||||||
en
|
en
|
||||||
if s:mwreverse | cal reverse(lines) | en
|
|
||||||
let s:matched = copy(lines)
|
let s:matched = copy(lines)
|
||||||
|
if s:mwreverse | cal reverse(lines) | en
|
||||||
|
let s:lines = copy(lines)
|
||||||
cal map(lines, 's:formatline(v:val, a:ipt)')
|
cal map(lines, 's:formatline(v:val, a:ipt)')
|
||||||
cal setline(1, lines)
|
cal setline(1, lines)
|
||||||
setl noma cul
|
setl noma cul
|
||||||
@@ -463,6 +464,17 @@ fu! s:BuildPrompt(upd, ...)
|
|||||||
exe 'echoh' hibase '| echon "_" | echoh None'
|
exe 'echoh' hibase '| echon "_" | echoh None'
|
||||||
en
|
en
|
||||||
endf
|
endf
|
||||||
|
" - SetDefTxt() {{{1
|
||||||
|
fu! s:SetDefTxt()
|
||||||
|
if s:deftxt == '0' || s:pathmode == 1 | retu | en
|
||||||
|
let txt = s:deftxt
|
||||||
|
if !type(txt)
|
||||||
|
let txt = txt && !stridx(s:crfpath, s:dyncwd)
|
||||||
|
\ ? ctrlp#rmbasedir([s:crfpath])[0] : ''
|
||||||
|
let txt = txt != '' ? txt.s:lash(s:crfpath) : ''
|
||||||
|
en
|
||||||
|
let s:prompt[0] = txt
|
||||||
|
endf
|
||||||
" ** Prt Actions {{{1
|
" ** Prt Actions {{{1
|
||||||
" Editing {{{2
|
" Editing {{{2
|
||||||
fu! s:PrtClear()
|
fu! s:PrtClear()
|
||||||
@@ -506,16 +518,20 @@ endf
|
|||||||
|
|
||||||
fu! s:PrtInsert(type)
|
fu! s:PrtInsert(type)
|
||||||
unl! s:hstgot
|
unl! s:hstgot
|
||||||
|
let s:act_add = 1
|
||||||
let s:prompt[0] .= a:type == 'w' ? s:crword
|
let s:prompt[0] .= a:type == 'w' ? s:crword
|
||||||
\ : a:type == 's' ? getreg('/')
|
\ : a:type == 's' ? getreg('/')
|
||||||
\ : a:type == 'v' ? s:crvisual
|
\ : a:type == 'v' ? s:crvisual
|
||||||
\ : a:type == '+' ? substitute(getreg('+'), '\n', '\\n', 'g') : s:prompt[0]
|
\ : a:type == '+' ? substitute(getreg('+'), '\n', '\\n', 'g') : s:prompt[0]
|
||||||
cal s:BuildPrompt(1)
|
cal s:BuildPrompt(1)
|
||||||
|
unl s:act_add
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fu! s:PrtExpandDir()
|
fu! s:PrtExpandDir()
|
||||||
let prt = s:prompt
|
let prt = s:prompt
|
||||||
if prt[0] == '' | retu | en
|
if prt[0] == '' | retu | en
|
||||||
|
unl! s:hstgot
|
||||||
|
let s:act_add = 1
|
||||||
let [base, seed] = s:headntail(prt[0])
|
let [base, seed] = s:headntail(prt[0])
|
||||||
let dirs = s:dircompl(base, seed)
|
let dirs = s:dircompl(base, seed)
|
||||||
if len(dirs) == 1
|
if len(dirs) == 1
|
||||||
@@ -524,6 +540,7 @@ fu! s:PrtExpandDir()
|
|||||||
let prt[0] .= s:findcommon(dirs, prt[0])
|
let prt[0] .= s:findcommon(dirs, prt[0])
|
||||||
en
|
en
|
||||||
cal s:BuildPrompt(1)
|
cal s:BuildPrompt(1)
|
||||||
|
unl s:act_add
|
||||||
endf
|
endf
|
||||||
" Movement {{{2
|
" Movement {{{2
|
||||||
fu! s:PrtCurLeft()
|
fu! s:PrtCurLeft()
|
||||||
@@ -562,7 +579,7 @@ fu! s:PrtSelectMove(dir)
|
|||||||
endf
|
endf
|
||||||
|
|
||||||
fu! s:PrtSelectJump(char, ...)
|
fu! s:PrtSelectJump(char, ...)
|
||||||
let lines = copy(s:matched)
|
let lines = copy(s:lines)
|
||||||
if a:0
|
if a:0
|
||||||
cal map(lines, 'split(v:val, ''[\/]\ze[^\/]\+$'')[-1]')
|
cal map(lines, 'split(v:val, ''[\/]\ze[^\/]\+$'')[-1]')
|
||||||
en
|
en
|
||||||
@@ -804,7 +821,7 @@ fu! s:AcceptSelection(mode)
|
|||||||
let str = join(s:prompt, '')
|
let str = join(s:prompt, '')
|
||||||
if a:mode == 'e' | if s:SpecInputs(str) | retu | en | en
|
if a:mode == 'e' | if s:SpecInputs(str) | retu | en | en
|
||||||
" Get the selected line
|
" Get the selected line
|
||||||
let line = !empty(s:matched) ? s:matched[line('.') - 1] : ''
|
let line = !empty(s:lines) ? s:lines[line('.') - 1] : ''
|
||||||
if a:mode != 'e' && s:itemtype < 3 && line == ''
|
if a:mode != 'e' && s:itemtype < 3 && line == ''
|
||||||
\ && str !~ '\v^(\.\.|/|\\|\?)$'
|
\ && str !~ '\v^(\.\.|/|\\|\?)$'
|
||||||
cal s:CreateNewFile(a:mode) | retu
|
cal s:CreateNewFile(a:mode) | retu
|
||||||
@@ -852,7 +869,7 @@ fu! s:MarkToOpen()
|
|||||||
if s:bufnr <= 0 || s:opmul == '0' || ( s:itemtype > 2 && s:type() !~ 'rts' )
|
if s:bufnr <= 0 || s:opmul == '0' || ( s:itemtype > 2 && s:type() !~ 'rts' )
|
||||||
retu
|
retu
|
||||||
en
|
en
|
||||||
let line = !empty(s:matched) ? s:matched[line('.') - 1] : ''
|
let line = !empty(s:lines) ? s:lines[line('.') - 1] : ''
|
||||||
if empty(line) | retu | en
|
if empty(line) | retu | en
|
||||||
let filpath = fnamemodify(line, ':p')
|
let filpath = fnamemodify(line, ':p')
|
||||||
if exists('s:marked') && s:dictindex(s:marked, filpath) > 0
|
if exists('s:marked') && s:dictindex(s:marked, filpath) > 0
|
||||||
@@ -1260,8 +1277,8 @@ endf
|
|||||||
|
|
||||||
fu! s:remarksigns()
|
fu! s:remarksigns()
|
||||||
if !s:dosigns() | retu | en
|
if !s:dosigns() | retu | en
|
||||||
for ic in range(1, len(s:matched))
|
for ic in range(1, len(s:lines))
|
||||||
let key = s:dictindex(s:marked, fnamemodify(s:matched[ic - 1], ':p'))
|
let key = s:dictindex(s:marked, fnamemodify(s:lines[ic - 1], ':p'))
|
||||||
if key > 0
|
if key > 0
|
||||||
exe 'sign place' key 'line='.ic.' name=ctrlpmark buffer='.s:bufnr
|
exe 'sign place' key 'line='.ic.' name=ctrlpmark buffer='.s:bufnr
|
||||||
en
|
en
|
||||||
@@ -1271,7 +1288,7 @@ endf
|
|||||||
fu! s:dosigns()
|
fu! s:dosigns()
|
||||||
retu exists('s:marked') && s:bufnr > 0 && s:opmul != '0' && has('signs')
|
retu exists('s:marked') && s:bufnr > 0 && s:opmul != '0' && has('signs')
|
||||||
endf
|
endf
|
||||||
" Dictionaries {{{2
|
" Lists & Dictionaries {{{2
|
||||||
fu! s:dictindex(dict, expr)
|
fu! s:dictindex(dict, expr)
|
||||||
for key in keys(a:dict)
|
for key in keys(a:dict)
|
||||||
if a:dict[key] == a:expr | retu key | en
|
if a:dict[key] == a:expr | retu key | en
|
||||||
@@ -1282,6 +1299,10 @@ endf
|
|||||||
fu! s:vacantdict(dict)
|
fu! s:vacantdict(dict)
|
||||||
retu filter(range(1, max(keys(a:dict))), '!has_key(a:dict, v:val)')
|
retu filter(range(1, max(keys(a:dict))), '!has_key(a:dict, v:val)')
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
fu! s:sublist(l, s, e)
|
||||||
|
retu v:version > 701 ? a:l[(a:s):(a:e)] : remove(copy(a:l), a:s, a:e)
|
||||||
|
endf
|
||||||
" Buffers {{{2
|
" Buffers {{{2
|
||||||
fu! s:buftab(bufnr, md)
|
fu! s:buftab(bufnr, md)
|
||||||
for tabnr in range(1, tabpagenr('$'))
|
for tabnr in range(1, tabpagenr('$'))
|
||||||
@@ -1374,66 +1395,17 @@ fu! s:argmaps(md, ...)
|
|||||||
retu a:md
|
retu a:md
|
||||||
endf
|
endf
|
||||||
" Misc {{{2
|
" Misc {{{2
|
||||||
|
fu! s:dosort()
|
||||||
|
retu s:matcher == {} && ( ( s:itemtype != 2 && !exists('g:ctrlp_nolimit') )
|
||||||
|
\ || s:prompt != ['', '', ''] ) && s:getextvar('sort')
|
||||||
|
endf
|
||||||
|
|
||||||
fu! s:narrowable()
|
fu! s:narrowable()
|
||||||
retu exists('s:act_add') && exists('s:matched') && s:matched != []
|
retu exists('s:act_add') && exists('s:matched') && s:matched != []
|
||||||
\ && exists('s:mdata') && s:mdata[:2] == [s:dyncwd, s:itemtype, s:regexp]
|
\ && exists('s:mdata') && s:mdata[:2] == [s:dyncwd, s:itemtype, s:regexp]
|
||||||
\ && s:matcher == {}
|
\ && s:matcher == {}
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fu! s:matargs(mfunc, str)
|
|
||||||
let match_type = {
|
|
||||||
\ 'match': 'full-line',
|
|
||||||
\ 's:matchfname': 'filename-only',
|
|
||||||
\ 's:matchtabs': 'first-non-tab',
|
|
||||||
\ 's:matchtabe': 'until-last-tab',
|
|
||||||
\ }
|
|
||||||
retu [s:matcher['match'], a:str, match_type[a:mfunc]]
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:log(m)
|
|
||||||
if exists('g:ctrlp_log') && g:ctrlp_log | if a:m
|
|
||||||
let cadir = ctrlp#utils#cachedir()
|
|
||||||
sil! exe 'redi! >' cadir.s:lash(cadir).'ctrlp.log'
|
|
||||||
el
|
|
||||||
sil! redi END
|
|
||||||
en | en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:strwidth(str)
|
|
||||||
retu exists('*strdisplaywidth') ? strdisplaywidth(a:str) : strlen(a:str)
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:getenv()
|
|
||||||
let [s:cwd, s:winres] = [getcwd(), [winrestcmd(), &lines, winnr('$')]]
|
|
||||||
let [s:crfile, s:crfpath] = [expand('%:p', 1), expand('%:p:h', 1)]
|
|
||||||
let [s:crword, s:crline] = [expand('<cword>'), getline('.')]
|
|
||||||
let [s:winh, s:crcursor] = [min([s:mxheight, &lines]), getpos('.')]
|
|
||||||
let [s:crbufnr, s:crvisual] = [bufnr('%'), s:lastvisual()]
|
|
||||||
let s:currwin = s:mwbottom ? winnr() : winnr() + has('autocmd')
|
|
||||||
let s:wpmode = exists('b:ctrlp_working_path_mode')
|
|
||||||
\ ? b:ctrlp_working_path_mode : s:pathmode
|
|
||||||
if exists('g:ctrlp_extensions')
|
|
||||||
if index(g:ctrlp_extensions, 'undo') >= 0
|
|
||||||
let s:undos = s:getundo()
|
|
||||||
en
|
|
||||||
if index(g:ctrlp_extensions, 'tag') >= 0
|
|
||||||
let s:tagfiles = s:tagfiles()
|
|
||||||
en
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:lastvisual()
|
|
||||||
let cview = winsaveview()
|
|
||||||
let [ovreg, ovtype] = [getreg('v'), getregtype('v')]
|
|
||||||
let [oureg, outype] = [getreg('"'), getregtype('"')]
|
|
||||||
sil! norm! gv"vy
|
|
||||||
let selected = substitute(getreg('v'), '\n', '\\n', 'g')
|
|
||||||
cal setreg('v', ovreg, ovtype)
|
|
||||||
cal setreg('"', oureg, outype)
|
|
||||||
cal winrestview(cview)
|
|
||||||
retu selected
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:migemo(str)
|
fu! s:migemo(str)
|
||||||
let str = a:str
|
let str = a:str
|
||||||
let dict = s:glbpath(&rtp, printf("dict/%s/migemo-dict", &enc), 1)
|
let dict = s:glbpath(&rtp, printf("dict/%s/migemo-dict", &enc), 1)
|
||||||
@@ -1450,6 +1422,73 @@ fu! s:migemo(str)
|
|||||||
retu str
|
retu str
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
fu! s:strwidth(str)
|
||||||
|
retu exists('*strdisplaywidth') ? strdisplaywidth(a:str) : strlen(a:str)
|
||||||
|
endf
|
||||||
|
|
||||||
|
fu! ctrlp#j2l(nr)
|
||||||
|
exe a:nr
|
||||||
|
sil! norm! zvzz
|
||||||
|
endf
|
||||||
|
|
||||||
|
fu! s:maxf(len)
|
||||||
|
retu s:maxfiles && a:len > s:maxfiles ? 1 : 0
|
||||||
|
endf
|
||||||
|
|
||||||
|
fu! s:regexfilter(str)
|
||||||
|
let str = a:str
|
||||||
|
for key in keys(s:fpats) | if match(str, key) >= 0
|
||||||
|
let str = substitute(str, s:fpats[key], '', 'g')
|
||||||
|
en | endfo
|
||||||
|
retu str
|
||||||
|
endf
|
||||||
|
|
||||||
|
fu! s:walker(m, p, d)
|
||||||
|
retu a:d > 0 ? a:p < a:m ? a:p + a:d : 0 : a:p > 0 ? a:p + a:d : a:m
|
||||||
|
endf
|
||||||
|
|
||||||
|
fu! s:matargs(mfunc, str)
|
||||||
|
let match_type = {
|
||||||
|
\ 'match': 'full-line',
|
||||||
|
\ 's:matchfname': 'filename-only',
|
||||||
|
\ 's:matchtabs': 'first-non-tab',
|
||||||
|
\ 's:matchtabe': 'until-last-tab',
|
||||||
|
\ }
|
||||||
|
retu [s:matcher['match'], a:str, match_type[a:mfunc]]
|
||||||
|
endf
|
||||||
|
" Entering & Exiting {{{2
|
||||||
|
fu! s:getenv()
|
||||||
|
let [s:cwd, s:winres] = [getcwd(), [winrestcmd(), &lines, winnr('$')]]
|
||||||
|
let [s:crfile, s:crfpath] = [expand('%:p', 1), expand('%:p:h', 1)]
|
||||||
|
let [s:crword, s:crline] = [expand('<cword>'), getline('.')]
|
||||||
|
let [s:winh, s:crcursor] = [min([s:mxheight, &lines]), getpos('.')]
|
||||||
|
let [s:crbufnr, s:crvisual] = [bufnr('%'), s:lastvisual()]
|
||||||
|
let s:currwin = s:mwbottom ? winnr() : winnr() + has('autocmd')
|
||||||
|
let s:wpmode = exists('b:ctrlp_working_path_mode')
|
||||||
|
\ ? b:ctrlp_working_path_mode : s:pathmode
|
||||||
|
endf
|
||||||
|
|
||||||
|
fu! s:lastvisual()
|
||||||
|
let cview = winsaveview()
|
||||||
|
let [ovreg, ovtype] = [getreg('v'), getregtype('v')]
|
||||||
|
let [oureg, outype] = [getreg('"'), getregtype('"')]
|
||||||
|
sil! norm! gv"vy
|
||||||
|
let selected = substitute(getreg('v'), '\n', '\\n', 'g')
|
||||||
|
cal setreg('v', ovreg, ovtype)
|
||||||
|
cal setreg('"', oureg, outype)
|
||||||
|
cal winrestview(cview)
|
||||||
|
retu selected
|
||||||
|
endf
|
||||||
|
|
||||||
|
fu! s:log(m)
|
||||||
|
if exists('g:ctrlp_log') && g:ctrlp_log | if a:m
|
||||||
|
let cadir = ctrlp#utils#cachedir()
|
||||||
|
sil! exe 'redi! >' cadir.s:lash(cadir).'ctrlp.log'
|
||||||
|
el
|
||||||
|
sil! redi END
|
||||||
|
en | en
|
||||||
|
endf
|
||||||
|
|
||||||
fu! s:openfile(cmd, fid, tail, ...)
|
fu! s:openfile(cmd, fid, tail, ...)
|
||||||
let cmd = a:cmd =~ '^[eb]$' && &modified ? 'hid '.a:cmd : a:cmd
|
let cmd = a:cmd =~ '^[eb]$' && &modified ? 'hid '.a:cmd : a:cmd
|
||||||
let cmd = cmd =~ '^tab' ? tabpagenr('$').cmd : cmd
|
let cmd = cmd =~ '^tab' ? tabpagenr('$').cmd : cmd
|
||||||
@@ -1465,32 +1504,7 @@ fu! s:openfile(cmd, fid, tail, ...)
|
|||||||
cal ctrlp#setlcdir()
|
cal ctrlp#setlcdir()
|
||||||
en
|
en
|
||||||
endf
|
endf
|
||||||
|
" Matchfuncs {{{2
|
||||||
fu! s:writecache(read_cache, cache_file)
|
|
||||||
if !a:read_cache && ( ( g:ctrlp_newcache || !filereadable(a:cache_file) )
|
|
||||||
\ && s:caching || len(g:ctrlp_allfiles) > s:nocache_lim )
|
|
||||||
if len(g:ctrlp_allfiles) > s:nocache_lim | let s:caching = 1 | en
|
|
||||||
cal ctrlp#utils#writecache(g:ctrlp_allfiles)
|
|
||||||
en
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! ctrlp#j2l(nr)
|
|
||||||
exe a:nr
|
|
||||||
sil! norm! zvzz
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:regexfilter(str)
|
|
||||||
let str = a:str
|
|
||||||
for key in keys(s:fpats) | if match(str, key) >= 0
|
|
||||||
let str = substitute(str, s:fpats[key], '', 'g')
|
|
||||||
en | endfo
|
|
||||||
retu str
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:walker(m, p, d)
|
|
||||||
retu a:d > 0 ? a:p < a:m ? a:p + a:d : 0 : a:p > 0 ? a:p + a:d : a:m
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:matchfname(item, pat)
|
fu! s:matchfname(item, pat)
|
||||||
retu match(split(a:item, s:lash)[-1], a:pat)
|
retu match(split(a:item, s:lash)[-1], a:pat)
|
||||||
endf
|
endf
|
||||||
@@ -1502,9 +1516,13 @@ endf
|
|||||||
fu! s:matchtabe(item, pat)
|
fu! s:matchtabe(item, pat)
|
||||||
retu match(split(a:item, '\t\+[^\t]\+$')[0], a:pat)
|
retu match(split(a:item, '\t\+[^\t]\+$')[0], a:pat)
|
||||||
endf
|
endf
|
||||||
|
" Cache {{{2
|
||||||
fu! s:maxf(len)
|
fu! s:writecache(read_cache, cache_file)
|
||||||
retu s:maxfiles && a:len > s:maxfiles ? 1 : 0
|
if !a:read_cache && ( ( g:ctrlp_newcache || !filereadable(a:cache_file) )
|
||||||
|
\ && s:caching || len(g:ctrlp_allfiles) > s:nocache_lim )
|
||||||
|
if len(g:ctrlp_allfiles) > s:nocache_lim | let s:caching = 1 | en
|
||||||
|
cal ctrlp#utils#writecache(g:ctrlp_allfiles)
|
||||||
|
en
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fu! s:insertcache(str)
|
fu! s:insertcache(str)
|
||||||
@@ -1529,27 +1547,19 @@ fu! s:type(...)
|
|||||||
\ ? g:ctrlp_ext_vars[s:itemtype - 3][a:0 ? 'type' : 'sname'] : s:itemtype
|
\ ? g:ctrlp_ext_vars[s:itemtype - 3][a:0 ? 'type' : 'sname'] : s:itemtype
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fu! s:tagfiles()
|
fu! s:execextvar(key)
|
||||||
retu filter(map(tagfiles(), 'fnamemodify(v:val, ":p")'), 'filereadable(v:val)')
|
|
||||||
endf
|
|
||||||
|
|
||||||
fu! s:extvar(key)
|
|
||||||
if exists('g:ctrlp_ext_vars')
|
if exists('g:ctrlp_ext_vars')
|
||||||
cal map(filter(copy(g:ctrlp_ext_vars),
|
cal map(filter(copy(g:ctrlp_ext_vars),
|
||||||
\ 'has_key(v:val, a:key)'), 'eval(v:val[a:key])')
|
\ 'has_key(v:val, a:key)'), 'eval(v:val[a:key])')
|
||||||
en
|
en
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fu! s:getundo()
|
fu! s:getextvar(key)
|
||||||
if exists('*undotree')
|
if s:itemtype > 2
|
||||||
\ && ( v:version > 703 || ( v:version == 703 && has('patch005') ) )
|
let vars = g:ctrlp_ext_vars[s:itemtype - 3]
|
||||||
retu [1, undotree()]
|
retu has_key(vars, a:key) ? vars[a:key] : -1
|
||||||
el
|
|
||||||
redi => result
|
|
||||||
sil! undol
|
|
||||||
redi END
|
|
||||||
retu [0, split(result, "\n")[1:]]
|
|
||||||
en
|
en
|
||||||
|
retu -1
|
||||||
endf
|
endf
|
||||||
|
|
||||||
fu! ctrlp#exit()
|
fu! ctrlp#exit()
|
||||||
@@ -1567,11 +1577,7 @@ endf
|
|||||||
" * Initialization {{{1
|
" * Initialization {{{1
|
||||||
fu! ctrlp#setlines(type)
|
fu! ctrlp#setlines(type)
|
||||||
let s:itemtype = a:type
|
let s:itemtype = a:type
|
||||||
let types = [
|
let types = ['ctrlp#files()', 'ctrlp#buffers()', 'ctrlp#mrufiles#list()']
|
||||||
\ 'ctrlp#files()',
|
|
||||||
\ 'ctrlp#buffers()',
|
|
||||||
\ 'ctrlp#mrufiles#list()',
|
|
||||||
\ ]
|
|
||||||
if exists('g:ctrlp_ext_vars')
|
if exists('g:ctrlp_ext_vars')
|
||||||
cal map(copy(g:ctrlp_ext_vars), 'add(types, v:val["init"])')
|
cal map(copy(g:ctrlp_ext_vars), 'add(types, v:val["init"])')
|
||||||
en
|
en
|
||||||
@@ -1583,6 +1589,7 @@ fu! ctrlp#init(type, ...)
|
|||||||
let [s:matches, s:init] = [1, 1]
|
let [s:matches, s:init] = [1, 1]
|
||||||
cal s:Open()
|
cal s:Open()
|
||||||
cal s:SetWD(a:0 ? a:1 : '')
|
cal s:SetWD(a:0 ? a:1 : '')
|
||||||
|
cal s:SetDefTxt()
|
||||||
cal s:MapKeys()
|
cal s:MapKeys()
|
||||||
if has('syntax') && exists('g:syntax_on')
|
if has('syntax') && exists('g:syntax_on')
|
||||||
cal ctrlp#syntax()
|
cal ctrlp#syntax()
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ let s:changes_var = {
|
|||||||
\ 'sname': 'chs',
|
\ 'sname': 'chs',
|
||||||
\ 'exit': 'ctrlp#changes#exit()',
|
\ 'exit': 'ctrlp#changes#exit()',
|
||||||
\ 'type': 'tabe',
|
\ 'type': 'tabe',
|
||||||
|
\ 'sort': 0,
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars)
|
let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars)
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ let s:var_qf = {
|
|||||||
\ 'lname': 'quickfix',
|
\ 'lname': 'quickfix',
|
||||||
\ 'sname': 'qfx',
|
\ 'sname': 'qfx',
|
||||||
\ 'type': 'line',
|
\ 'type': 'line',
|
||||||
|
\ 'sort': 0,
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars)
|
let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars)
|
||||||
|
|||||||
@@ -11,10 +11,11 @@ en
|
|||||||
let g:loaded_ctrlp_tag = 1
|
let g:loaded_ctrlp_tag = 1
|
||||||
|
|
||||||
let s:tag_var = {
|
let s:tag_var = {
|
||||||
\ 'init': 'ctrlp#tag#init(s:tagfiles)',
|
\ 'init': 'ctrlp#tag#init()',
|
||||||
\ 'accept': 'ctrlp#tag#accept',
|
\ 'accept': 'ctrlp#tag#accept',
|
||||||
\ 'lname': 'tags',
|
\ 'lname': 'tags',
|
||||||
\ 'sname': 'tag',
|
\ 'sname': 'tag',
|
||||||
|
\ 'enter': 'ctrlp#tag#enter()',
|
||||||
\ 'type': 'tabs',
|
\ 'type': 'tabs',
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
@@ -57,10 +58,10 @@ fu! s:filter(tags)
|
|||||||
retu alltags
|
retu alltags
|
||||||
endf
|
endf
|
||||||
" Public {{{1
|
" Public {{{1
|
||||||
fu! ctrlp#tag#init(tagfiles)
|
fu! ctrlp#tag#init()
|
||||||
if empty(a:tagfiles) | retu [] | en
|
if empty(s:tagfiles) | retu [] | en
|
||||||
let g:ctrlp_alltags = []
|
let g:ctrlp_alltags = []
|
||||||
let tagfiles = sort(filter(a:tagfiles, 'count(a:tagfiles, v:val) == 1'))
|
let tagfiles = sort(filter(s:tagfiles, 'count(s:tagfiles, v:val) == 1'))
|
||||||
for each in tagfiles
|
for each in tagfiles
|
||||||
let alltags = s:filter(ctrlp#utils#readfile(each))
|
let alltags = s:filter(ctrlp#utils#readfile(each))
|
||||||
cal extend(g:ctrlp_alltags, alltags)
|
cal extend(g:ctrlp_alltags, alltags)
|
||||||
@@ -101,6 +102,12 @@ endf
|
|||||||
fu! ctrlp#tag#id()
|
fu! ctrlp#tag#id()
|
||||||
retu s:id
|
retu s:id
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
fu! ctrlp#tag#enter()
|
||||||
|
let tfs = tagfiles()
|
||||||
|
let s:tagfiles = tfs != [] ? filter(map(tfs, 'fnamemodify(v:val, ":p")'),
|
||||||
|
\ 'filereadable(v:val)') : []
|
||||||
|
endf
|
||||||
"}}}
|
"}}}
|
||||||
|
|
||||||
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2
|
||||||
|
|||||||
@@ -11,12 +11,14 @@ en
|
|||||||
let g:loaded_ctrlp_undo = 1
|
let g:loaded_ctrlp_undo = 1
|
||||||
|
|
||||||
let s:undo_var = {
|
let s:undo_var = {
|
||||||
\ 'init': 'ctrlp#undo#init(s:undos)',
|
\ 'init': 'ctrlp#undo#init()',
|
||||||
\ 'accept': 'ctrlp#undo#accept',
|
\ 'accept': 'ctrlp#undo#accept',
|
||||||
\ 'lname': 'undo',
|
\ 'lname': 'undo',
|
||||||
\ 'sname': 'udo',
|
\ 'sname': 'udo',
|
||||||
|
\ 'enter': 'ctrlp#undo#enter()',
|
||||||
\ 'exit': 'ctrlp#undo#exit()',
|
\ 'exit': 'ctrlp#undo#exit()',
|
||||||
\ 'type': 'line',
|
\ 'type': 'line',
|
||||||
|
\ 'sort': 0,
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars)
|
let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars)
|
||||||
@@ -27,6 +29,18 @@ let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars)
|
|||||||
let s:text = map(['second', 'seconds', 'minutes', 'hours', 'days', 'weeks',
|
let s:text = map(['second', 'seconds', 'minutes', 'hours', 'days', 'weeks',
|
||||||
\ 'months', 'years'], '" ".v:val." ago"')
|
\ 'months', 'years'], '" ".v:val." ago"')
|
||||||
" Utilities {{{1
|
" Utilities {{{1
|
||||||
|
fu! s:getundo()
|
||||||
|
if exists('*undotree')
|
||||||
|
\ && ( v:version > 703 || ( v:version == 703 && has('patch005') ) )
|
||||||
|
retu [1, undotree()]
|
||||||
|
el
|
||||||
|
redi => result
|
||||||
|
sil! undol
|
||||||
|
redi END
|
||||||
|
retu [0, split(result, "\n")[1:]]
|
||||||
|
en
|
||||||
|
endf
|
||||||
|
|
||||||
fu! s:flatten(tree, cur)
|
fu! s:flatten(tree, cur)
|
||||||
let flatdict = {}
|
let flatdict = {}
|
||||||
for each in a:tree
|
for each in a:tree
|
||||||
@@ -104,16 +118,16 @@ fu! s:formatul(...)
|
|||||||
retu parts[2].' ['.parts[1].']'.( parts[3] != '' ? ' saved' : '' )
|
retu parts[2].' ['.parts[1].']'.( parts[3] != '' ? ' saved' : '' )
|
||||||
endf
|
endf
|
||||||
" Public {{{1
|
" Public {{{1
|
||||||
fu! ctrlp#undo#init(undo)
|
fu! ctrlp#undo#init()
|
||||||
let entries = a:undo[0] ? a:undo[1]['entries'] : a:undo[1]
|
let entries = s:undos[0] ? s:undos[1]['entries'] : s:undos[1]
|
||||||
if empty(entries) | retu [] | en
|
if empty(entries) | retu [] | en
|
||||||
if has('syntax') && exists('g:syntax_on')
|
if has('syntax') && exists('g:syntax_on')
|
||||||
cal s:syntax()
|
cal s:syntax()
|
||||||
en
|
en
|
||||||
let g:ctrlp_nolimit = 1
|
let g:ctrlp_nolimit = 1
|
||||||
if !exists('s:lines')
|
if !exists('s:lines')
|
||||||
if a:undo[0]
|
if s:undos[0]
|
||||||
let entries = s:dict2list(s:flatten(entries, a:undo[1]['seq_cur']))
|
let entries = s:dict2list(s:flatten(entries, s:undos[1]['seq_cur']))
|
||||||
let s:lines = map(sort(entries, 's:compval'), 's:format(v:val)')
|
let s:lines = map(sort(entries, 's:compval'), 's:format(v:val)')
|
||||||
el
|
el
|
||||||
let s:lines = map(reverse(entries), 's:formatul(v:val)')
|
let s:lines = map(reverse(entries), 's:formatul(v:val)')
|
||||||
@@ -133,6 +147,10 @@ fu! ctrlp#undo#id()
|
|||||||
retu s:id
|
retu s:id
|
||||||
endf
|
endf
|
||||||
|
|
||||||
|
fu! ctrlp#undo#enter()
|
||||||
|
let s:undos = s:getundo()
|
||||||
|
endf
|
||||||
|
|
||||||
fu! ctrlp#undo#exit()
|
fu! ctrlp#undo#exit()
|
||||||
unl! s:lines
|
unl! s:lines
|
||||||
endf
|
endf
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ OPTIONS *ctrlp-options*
|
|||||||
Below are the available options and their default values:~
|
Below are the available options and their default values:~
|
||||||
|
|
||||||
*'g:ctrlp_map'*
|
*'g:ctrlp_map'*
|
||||||
Use this option to change the mapping to invoke |CtrlP| in |Normal| mode: >
|
Use this option to change the mapping to invoke CtrlP in |Normal| mode: >
|
||||||
let g:ctrlp_map = '<c-p>'
|
let g:ctrlp_map = '<c-p>'
|
||||||
<
|
<
|
||||||
|
|
||||||
@@ -51,7 +51,8 @@ Use this to disable the plugin completely: >
|
|||||||
<
|
<
|
||||||
|
|
||||||
*'g:ctrlp_by_filename'*
|
*'g:ctrlp_by_filename'*
|
||||||
Set this to 1 to set searching by filename (not full path) as the default: >
|
Set this to 1 to set searching by filename (as opposed to full path) as the
|
||||||
|
default: >
|
||||||
let g:ctrlp_by_filename = 0
|
let g:ctrlp_by_filename = 0
|
||||||
<
|
<
|
||||||
Can be toggled on/off by pressing <c-d> inside the prompt.
|
Can be toggled on/off by pressing <c-d> inside the prompt.
|
||||||
@@ -80,7 +81,7 @@ Set the maximum height of the match window: >
|
|||||||
|
|
||||||
*'g:ctrlp_switch_buffer'*
|
*'g:ctrlp_switch_buffer'*
|
||||||
When opening a file with <cr> or <c-t>, if the file’s already opened somewhere
|
When opening a file with <cr> or <c-t>, if the file’s already opened somewhere
|
||||||
|CtrlP| will try to jump to it instead of opening a new instance: >
|
CtrlP will try to jump to it instead of opening a new instance: >
|
||||||
let g:ctrlp_switch_buffer = 2
|
let g:ctrlp_switch_buffer = 2
|
||||||
<
|
<
|
||||||
1 - only jump to the buffer if it’s opened in the current tab.
|
1 - only jump to the buffer if it’s opened in the current tab.
|
||||||
@@ -88,7 +89,7 @@ When opening a file with <cr> or <c-t>, if the file’s already opened somewhere
|
|||||||
0 - disable this feature.
|
0 - disable this feature.
|
||||||
|
|
||||||
*'g:ctrlp_reuse_window'*
|
*'g:ctrlp_reuse_window'*
|
||||||
When opening a file with <cr>, |CtrlP| avoids opening it in windows created by
|
When opening a file with <cr>, CtrlP avoids opening it in windows created by
|
||||||
plugins, help and quickfix. Use this to setup some exceptions: >
|
plugins, help and quickfix. Use this to setup some exceptions: >
|
||||||
let g:ctrlp_reuse_window = 'netrw'
|
let g:ctrlp_reuse_window = 'netrw'
|
||||||
<
|
<
|
||||||
@@ -99,7 +100,7 @@ Example: >
|
|||||||
<
|
<
|
||||||
|
|
||||||
*'g:ctrlp_working_path_mode'*
|
*'g:ctrlp_working_path_mode'*
|
||||||
When starting up, |CtrlP| sets its local working directory according to this
|
When starting up, CtrlP sets its local working directory according to this
|
||||||
variable: >
|
variable: >
|
||||||
let g:ctrlp_working_path_mode = 2
|
let g:ctrlp_working_path_mode = 2
|
||||||
<
|
<
|
||||||
@@ -111,19 +112,17 @@ Note: you can use b:ctrlp_working_path_mode (a |b:var|) to set this option on a
|
|||||||
per buffer basis.
|
per buffer basis.
|
||||||
|
|
||||||
*'g:ctrlp_root_markers'*
|
*'g:ctrlp_root_markers'*
|
||||||
Use this to set your own root markers in addition to the default ones. Your
|
Use this to set your own root markers in addition to the default ones (.git/,
|
||||||
markers will take precedence: >
|
.hg/, .svn/, .bzr/, and _darcs/). Your markers will take precedence: >
|
||||||
let g:ctrlp_root_markers = ['']
|
let g:ctrlp_root_markers = ['']
|
||||||
<
|
<
|
||||||
These markers (builtins and yours) will serve as identifiers for the '/' and
|
|
||||||
'\' special inputs (|ctrlp-input-formats| (e)).
|
|
||||||
|
|
||||||
*'g:ctrlp_use_caching'*
|
*'g:ctrlp_use_caching'*
|
||||||
Set this to 0 to disable per-session caching. When disabled, caching will still
|
Set this to 0 to disable per-session caching. When disabled, caching will still
|
||||||
be enabled for directories that have more than 4000 files: >
|
be enabled for directories that have more than 4000 files: >
|
||||||
let g:ctrlp_use_caching = 1
|
let g:ctrlp_use_caching = 1
|
||||||
<
|
<
|
||||||
Note: you can quickly purge the cache by pressing <F5> while inside |CtrlP|.
|
Note: you can quickly purge the cache by pressing <F5> while inside CtrlP.
|
||||||
|
|
||||||
*'g:ctrlp_clear_cache_on_exit'*
|
*'g:ctrlp_clear_cache_on_exit'*
|
||||||
Set this to 0 to enable cross-session caching by not deleting the cache files
|
Set this to 0 to enable cross-session caching by not deleting the cache files
|
||||||
@@ -137,7 +136,7 @@ Set the directory to store the cache files: >
|
|||||||
<
|
<
|
||||||
|
|
||||||
*'g:ctrlp_prompt_mappings'*
|
*'g:ctrlp_prompt_mappings'*
|
||||||
Use this to customize the mappings inside |CtrlP|’s prompt to your liking. You
|
Use this to customize the mappings inside CtrlP’s prompt to your liking. You
|
||||||
only need to keep the lines that you’ve changed the values (inside []): >
|
only need to keep the lines that you’ve changed the values (inside []): >
|
||||||
let g:ctrlp_prompt_mappings = {
|
let g:ctrlp_prompt_mappings = {
|
||||||
\ 'PrtBS()': ['<bs>', '<c-]>'],
|
\ 'PrtBS()': ['<bs>', '<c-]>'],
|
||||||
@@ -182,13 +181,12 @@ default <c-h> mapping: >
|
|||||||
<
|
<
|
||||||
|
|
||||||
*'g:ctrlp_mruf_max'*
|
*'g:ctrlp_mruf_max'*
|
||||||
Specify the number of recently opened files you want |CtrlP| to remember: >
|
Specify the number of recently opened files you want CtrlP to remember: >
|
||||||
let g:ctrlp_mruf_max = 250
|
let g:ctrlp_mruf_max = 250
|
||||||
<
|
<
|
||||||
|
|
||||||
*'g:ctrlp_mruf_exclude'*
|
*'g:ctrlp_mruf_exclude'*
|
||||||
Files you don’t want |CtrlP| to remember. Use |regexp| to specify the patterns:
|
Files you don’t want CtrlP to remember. Use |regexp| to specify the patterns: >
|
||||||
>
|
|
||||||
let g:ctrlp_mruf_exclude = ''
|
let g:ctrlp_mruf_exclude = ''
|
||||||
<
|
<
|
||||||
Examples: >
|
Examples: >
|
||||||
@@ -197,7 +195,7 @@ Examples: >
|
|||||||
<
|
<
|
||||||
|
|
||||||
*'g:ctrlp_mruf_include'*
|
*'g:ctrlp_mruf_include'*
|
||||||
And if you want |CtrlP| to only remember some files, specify them here: >
|
And if you want CtrlP to only remember some files, specify them here: >
|
||||||
let g:ctrlp_mruf_include = ''
|
let g:ctrlp_mruf_include = ''
|
||||||
<
|
<
|
||||||
Example: >
|
Example: >
|
||||||
@@ -221,7 +219,7 @@ Set to 1 to sort the MRU file list to most-recently-entered-buffer order: >
|
|||||||
<
|
<
|
||||||
|
|
||||||
*'g:ctrlp_dotfiles'*
|
*'g:ctrlp_dotfiles'*
|
||||||
Set this to 0 if you don’t want |CtrlP| to scan for dotfiles and dotdirs: >
|
Set this to 0 if you don’t want CtrlP to scan for dotfiles and dotdirs: >
|
||||||
let g:ctrlp_dotfiles = 1
|
let g:ctrlp_dotfiles = 1
|
||||||
<
|
<
|
||||||
You can use |'wildignore'| to exclude anything from the search.
|
You can use |'wildignore'| to exclude anything from the search.
|
||||||
@@ -239,7 +237,7 @@ tools on Windows). So be a little mindful of what you put in your |wildignore|.
|
|||||||
|
|
||||||
*'g:ctrlp_custom_ignore'*
|
*'g:ctrlp_custom_ignore'*
|
||||||
In addition to |'wildignore'|, use this for files and directories you want only
|
In addition to |'wildignore'|, use this for files and directories you want only
|
||||||
|CtrlP| to not show. Use |regexp| to specify the patterns: >
|
CtrlP to not show. Use |regexp| to specify the patterns: >
|
||||||
let g:ctrlp_custom_ignore = ''
|
let g:ctrlp_custom_ignore = ''
|
||||||
<
|
<
|
||||||
Examples: >
|
Examples: >
|
||||||
@@ -250,6 +248,7 @@ Examples: >
|
|||||||
\ 'link': 'SOME_BAD_SYMBOLIC_LINKS',
|
\ 'link': 'SOME_BAD_SYMBOLIC_LINKS',
|
||||||
\ }
|
\ }
|
||||||
<
|
<
|
||||||
|
Note: ignoring only works when |globpath()| is used to scan for files.
|
||||||
|
|
||||||
*'g:ctrlp_max_files'*
|
*'g:ctrlp_max_files'*
|
||||||
The maximum number of files to scan, set to 0 for no limit: >
|
The maximum number of files to scan, set to 0 for no limit: >
|
||||||
@@ -302,7 +301,7 @@ If the fallback_command is empty or not defined, |globpath()| will then be used
|
|||||||
when searching outside a repo.
|
when searching outside a repo.
|
||||||
|
|
||||||
*'g:ctrlp_max_history'*
|
*'g:ctrlp_max_history'*
|
||||||
The maximum number of input strings you want |CtrlP| to remember. The default
|
The maximum number of input strings you want CtrlP to remember. The default
|
||||||
value mirrors Vim’s global |'history'| option: >
|
value mirrors Vim’s global |'history'| option: >
|
||||||
let g:ctrlp_max_history = &history
|
let g:ctrlp_max_history = &history
|
||||||
<
|
<
|
||||||
@@ -368,6 +367,12 @@ after typing’s been stopped for a certain amount of time: >
|
|||||||
If is 1, update after 250ms. If bigger than 1, the number will be used as the
|
If is 1, update after 250ms. If bigger than 1, the number will be used as the
|
||||||
delay time in milliseconds.
|
delay time in milliseconds.
|
||||||
|
|
||||||
|
*'g:ctrlp_default_input'*
|
||||||
|
Set this to 1 to enable seeding the prompt with the current file’s relative
|
||||||
|
path: >
|
||||||
|
let g:ctrlp_default_input = 0
|
||||||
|
<
|
||||||
|
|
||||||
*'g:ctrlp_use_migemo'*
|
*'g:ctrlp_use_migemo'*
|
||||||
Set this to 1 to use Migemo Pattern for Japanese filenames. Migemo Search only
|
Set this to 1 to use Migemo Pattern for Japanese filenames. Migemo Search only
|
||||||
works in |regexp| mode. To split the pattern, separate words with space: >
|
works in |regexp| mode. To split the pattern, separate words with space: >
|
||||||
@@ -375,7 +380,7 @@ works in |regexp| mode. To split the pattern, separate words with space: >
|
|||||||
<
|
<
|
||||||
|
|
||||||
*'g:ctrlp_status_func'*
|
*'g:ctrlp_status_func'*
|
||||||
Use this to customize the statuslines for the |CtrlP| window: >
|
Use this to customize the statuslines for the CtrlP window: >
|
||||||
let g:ctrlp_status_func = {}
|
let g:ctrlp_status_func = {}
|
||||||
<
|
<
|
||||||
Example: >
|
Example: >
|
||||||
@@ -385,6 +390,7 @@ Example: >
|
|||||||
\ }
|
\ }
|
||||||
<
|
<
|
||||||
Structure of the functions: >
|
Structure of the functions: >
|
||||||
|
" Main statusline
|
||||||
function! Function_Name_1(focus, byfname, regex, prev, item, next, marked)
|
function! Function_Name_1(focus, byfname, regex, prev, item, next, marked)
|
||||||
" Arguments:
|
" Arguments:
|
||||||
" |
|
" |
|
||||||
@@ -406,6 +412,7 @@ Structure of the functions: >
|
|||||||
return full_statusline
|
return full_statusline
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" Progress statusline
|
||||||
function! Function_Name_2(str)
|
function! Function_Name_2(str)
|
||||||
" a:str : Either the number of files scanned so far, or a string indicating
|
" a:str : Either the number of files scanned so far, or a string indicating
|
||||||
" the current directory is being scanned with a user_command.
|
" the current directory is being scanned with a user_command.
|
||||||
@@ -416,7 +423,7 @@ Structure of the functions: >
|
|||||||
See https://gist.github.com/1610859 for a working example.
|
See https://gist.github.com/1610859 for a working example.
|
||||||
|
|
||||||
*'g:ctrlp_match_func'*
|
*'g:ctrlp_match_func'*
|
||||||
Set an external fuzzy matching function for |CtrlP| to use: >
|
Set an external fuzzy matching function for CtrlP to use: >
|
||||||
let g:ctrlp_match_func = {}
|
let g:ctrlp_match_func = {}
|
||||||
<
|
<
|
||||||
Example: >
|
Example: >
|
||||||
@@ -456,7 +463,7 @@ COMMANDS *ctrlp-commands*
|
|||||||
|
|
||||||
*:CtrlP*
|
*:CtrlP*
|
||||||
:CtrlP [starting-directory]
|
:CtrlP [starting-directory]
|
||||||
Open |CtrlP| in find file mode.
|
Open CtrlP in find file mode.
|
||||||
|
|
||||||
If no argument is given, the value of |g:ctrlp_working_path_mode| will be
|
If no argument is given, the value of |g:ctrlp_working_path_mode| will be
|
||||||
used to determine the starting directory.
|
used to determine the starting directory.
|
||||||
@@ -464,17 +471,17 @@ COMMANDS *ctrlp-commands*
|
|||||||
|
|
||||||
*:CtrlPBuffer*
|
*:CtrlPBuffer*
|
||||||
:CtrlPBuffer
|
:CtrlPBuffer
|
||||||
Open |CtrlP| in find buffer mode.
|
Open CtrlP in find buffer mode.
|
||||||
|
|
||||||
*:CtrlPMRU*
|
*:CtrlPMRU*
|
||||||
:CtrlPMRU
|
:CtrlPMRU
|
||||||
Open |CtrlP| in find Most-Recently-Used file mode.
|
Open CtrlP in find Most-Recently-Used file mode.
|
||||||
|
|
||||||
*:CtrlPClearCache*
|
*:CtrlPClearCache*
|
||||||
:CtrlPClearCache
|
:CtrlPClearCache
|
||||||
Flush the cache for the current working directory. The same as pressing <F5>
|
Flush the cache for the current working directory. The same as pressing <F5>
|
||||||
inside |CtrlP|.
|
inside CtrlP.
|
||||||
You can also enable/disable caching with the option |g:ctrlp_use_caching|.
|
You can enable/disable caching with the |g:ctrlp_use_caching| option.
|
||||||
|
|
||||||
*:CtrlPClearAllCaches*
|
*:CtrlPClearAllCaches*
|
||||||
:CtrlPClearAllCaches
|
:CtrlPClearAllCaches
|
||||||
@@ -501,20 +508,20 @@ MAPPINGS *ctrlp-mappings*
|
|||||||
|
|
||||||
*'ctrlp-<c-p>'*
|
*'ctrlp-<c-p>'*
|
||||||
<c-p>
|
<c-p>
|
||||||
Default |Normal| mode mapping to open the |CtrlP| prompt in find file mode.
|
Default |Normal| mode mapping to open the CtrlP prompt in find file mode.
|
||||||
|
|
||||||
Once inside the prompt:~
|
Once inside the prompt:~
|
||||||
|
|
||||||
|
<c-d>
|
||||||
|
Toggle between full-path search and filename only search.
|
||||||
|
Note: in filename mode, the prompt’s base is '>d>' instead of '>>>'
|
||||||
|
|
||||||
<c-r> *'ctrlp-fullregexp'*
|
<c-r> *'ctrlp-fullregexp'*
|
||||||
Toggle between the string mode and full |regexp| mode.
|
Toggle between the string mode and full |regexp| mode.
|
||||||
Note: in full |regexp| mode, the prompt’s base is 'r>>' instead of '>>>'
|
Note: in full |regexp| mode, the prompt’s base is 'r>>' instead of '>>>'
|
||||||
|
|
||||||
See also |input-formats| (guide) and |g:ctrlp_regexp_search| (option).
|
See also |input-formats| (guide) and |g:ctrlp_regexp_search| (option).
|
||||||
|
|
||||||
<c-d>
|
|
||||||
Toggle between full-path search and filename only search.
|
|
||||||
Note: in filename mode, the prompt’s base is '>d>' instead of '>>>'
|
|
||||||
|
|
||||||
<c-f>, 'forward'
|
<c-f>, 'forward'
|
||||||
<c-up>
|
<c-up>
|
||||||
Scroll to the 'next' search mode in the sequence.
|
Scroll to the 'next' search mode in the sequence.
|
||||||
@@ -575,9 +582,9 @@ Once inside the prompt:~
|
|||||||
<c-v>
|
<c-v>
|
||||||
Open selected file in a 'vertical' split.
|
Open selected file in a 'vertical' split.
|
||||||
|
|
||||||
|
<c-x>,
|
||||||
<c-cr>,
|
<c-cr>,
|
||||||
<c-s>,
|
<c-s>
|
||||||
<c-x>
|
|
||||||
Open selected file in a 'horizontal' split.
|
Open selected file in a 'horizontal' split.
|
||||||
|
|
||||||
<c-y>
|
<c-y>
|
||||||
@@ -591,26 +598,26 @@ Once inside the prompt:~
|
|||||||
|
|
||||||
<c-z>
|
<c-z>
|
||||||
- Mark/unmark a file to be opened with <c-o>.
|
- Mark/unmark a file to be opened with <c-o>.
|
||||||
- Mark/unmark a file to create a new file in its directory using <c-y>.
|
- Or mark/unmark a file to create a new file in its directory using <c-y>.
|
||||||
|
|
||||||
<c-o>
|
<c-o>
|
||||||
Open files marked by <c-z>.
|
Open files marked by <c-z>.
|
||||||
|
|
||||||
<F5>
|
<F5>
|
||||||
- Refresh the match window and purge the cache for the current directory.
|
- Refresh the match window and purge the cache for the current directory.
|
||||||
- Remove deleted files from MRU list.
|
- Or remove deleted files from the MRU list.
|
||||||
|
|
||||||
<F7>
|
<F7>
|
||||||
- Wipe MRU list.
|
- Wipe the MRU list.
|
||||||
- Delete MRU entries marked by <c-z>.
|
- Or delete MRU entries marked by <c-z>.
|
||||||
|
|
||||||
<insert>
|
<insert>
|
||||||
Insert the word under the cursor (in the active buffer) into the prompt.
|
Insert the word under the cursor (in the current buffer) into the prompt.
|
||||||
|
|
||||||
<esc>,
|
<esc>,
|
||||||
<c-c>,
|
<c-c>,
|
||||||
<c-g>
|
<c-g>
|
||||||
Exit |CtrlP|.
|
Exit CtrlP.
|
||||||
Note: <c-c> can also be used to stop the scan if it’s taking too long.
|
Note: <c-c> can also be used to stop the scan if it’s taking too long.
|
||||||
|
|
||||||
Choose your own mappings with |g:ctrlp_prompt_mappings|.
|
Choose your own mappings with |g:ctrlp_prompt_mappings|.
|
||||||
@@ -629,11 +636,13 @@ INPUT FORMATS *ctrlp-input-formats*
|
|||||||
Formats for inputting in the prompt:~
|
Formats for inputting in the prompt:~
|
||||||
|
|
||||||
a) Simple string.
|
a) Simple string.
|
||||||
e.g. 'abc' is understood internally as 'a[^a]\{-}b[^b]\{-}c'
|
|
||||||
|
E.g. 'abc' is understood internally as 'a[^a]\{-}b[^b]\{-}c'
|
||||||
|
|
||||||
b) Vim |regexp|. If the input string contains '*' or '|', it’ll be treated as
|
b) Vim |regexp|. If the input string contains '*' or '|', it’ll be treated as
|
||||||
a Vim’s |regexp| |pattern| without any modification.
|
a Vim’s |regexp| |pattern| without any modification.
|
||||||
e.g. 'abc\d*efg' will be read as 'abc\d*efg'.
|
|
||||||
|
E.g. 'abc\d*efg' will be read as 'abc\d*efg'.
|
||||||
|
|
||||||
See also |ctrlp-fullregexp| (keymap) and |g:ctrlp_regexp_search| (option).
|
See also |ctrlp-fullregexp| (keymap) and |g:ctrlp_regexp_search| (option).
|
||||||
|
|
||||||
@@ -641,13 +650,17 @@ c) End the string with a colon ':' followed by a Vim command to execute that
|
|||||||
command after opening the file. If you need to use ':' literally, escape it
|
command after opening the file. If you need to use ':' literally, escape it
|
||||||
with a backslash: '\:'. When opening multiple files, the command will be
|
with a backslash: '\:'. When opening multiple files, the command will be
|
||||||
executed on each opening file.
|
executed on each opening file.
|
||||||
e.g. 'abc:45' will open the selected file and jump to line 45.
|
|
||||||
'abc:/my\:string' will open the selected file and jump to the first
|
E.g. 'abc:45' will open the selected file and jump to line 45.
|
||||||
instance of 'my:function'.
|
|
||||||
|
'abc:/any\:string' will open the selected file and jump to the first
|
||||||
|
instance of 'any:string'.
|
||||||
|
|
||||||
'abc:+setf\ myfiletype|50' will open the selected file and set its
|
'abc:+setf\ myfiletype|50' will open the selected file and set its
|
||||||
filetype to 'myfiletype', then jump to line 50.
|
filetype to 'myfiletype', then jump to line 50.
|
||||||
'abc:diffthis' will open the selected file and run |:diffthis| on the
|
|
||||||
first 4 files.
|
'abc:diffthis' will open the selected files and run |:diffthis| on the
|
||||||
|
first 4 files (if marked).
|
||||||
|
|
||||||
See also Vim’s |++opt| and |+cmd|.
|
See also Vim’s |++opt| and |+cmd|.
|
||||||
|
|
||||||
@@ -662,11 +675,14 @@ e) Similarly, submit '/' or '\' to find and go to the project’s root. If the
|
|||||||
f) Type the name of a non-existent file and press <c-y> to create it. Mark a
|
f) Type the name of a non-existent file and press <c-y> to create it. Mark a
|
||||||
file with <c-z> to create the new file in the same directory as the marked
|
file with <c-z> to create the new file in the same directory as the marked
|
||||||
file.
|
file.
|
||||||
e.g. 'parentdir/newfile.txt' will create a directory named 'parentdir' as
|
|
||||||
|
E.g. 'parentdir/newfile.txt' will create a directory named 'parentdir' as
|
||||||
well as 'newfile.txt'.
|
well as 'newfile.txt'.
|
||||||
|
|
||||||
If 'some/old/dirs/oldfile.txt' is marked with <c-z>, then 'parentdir'
|
If 'some/old/dirs/oldfile.txt' is marked with <c-z>, then 'parentdir'
|
||||||
and 'newfile.txt' will be created in 'some/old/dirs'. The final path
|
and 'newfile.txt' will be created in 'some/old/dirs'. The final path
|
||||||
will then be 'some/old/dirs/parentdir/newfile.txt'.
|
will then be 'some/old/dirs/parentdir/newfile.txt'.
|
||||||
|
|
||||||
Use '\' in place of '/' on Windows (if |'ssl'| is not set).
|
Use '\' in place of '/' on Windows (if |'ssl'| is not set).
|
||||||
|
|
||||||
g) Submit ? to open this help file.
|
g) Submit ? to open this help file.
|
||||||
@@ -690,7 +706,8 @@ Available extensions:~
|
|||||||
- Command: ':CtrlPTag'
|
- Command: ':CtrlPTag'
|
||||||
- Search for a tag within a generated central tags file, and jump to the
|
- Search for a tag within a generated central tags file, and jump to the
|
||||||
definition. Use the Vim’s option |'tags'| to specify the names and the
|
definition. Use the Vim’s option |'tags'| to specify the names and the
|
||||||
locations of the tags file(s). Example: `set tags+=tags/help,doc/tags`
|
locations of the tags file(s).
|
||||||
|
E.g. set tags+=doc/tags
|
||||||
|
|
||||||
*:CtrlPBufTag*
|
*:CtrlPBufTag*
|
||||||
*:CtrlPBufTagAll*
|
*:CtrlPBufTagAll*
|
||||||
@@ -713,10 +730,10 @@ Available extensions:~
|
|||||||
- Command: ':CtrlPDir [starting-directory]'
|
- Command: ':CtrlPDir [starting-directory]'
|
||||||
- Search for a directory and change the working directory to it.
|
- Search for a directory and change the working directory to it.
|
||||||
- Mappings:
|
- Mappings:
|
||||||
+ <cr> change the local working directory for |CtrlP| and keep it open.
|
+ <cr> change the local working directory for CtrlP and keep it open.
|
||||||
+ <c-t> change the global working directory (exit).
|
+ <c-t> change the global working directory (exit).
|
||||||
+ <c-v> change the local working directory for the current window (exit).
|
+ <c-v> change the local working directory for the current window (exit).
|
||||||
+ <c-x> change the global working directory to |CtrlP|’s current local
|
+ <c-x> change the global working directory to CtrlP’s current local
|
||||||
working directory (exit).
|
working directory (exit).
|
||||||
|
|
||||||
*:CtrlPRTS*
|
*:CtrlPRTS*
|
||||||
@@ -778,7 +795,7 @@ Examples: >
|
|||||||
CUSTOMIZATION *ctrlp-customization*
|
CUSTOMIZATION *ctrlp-customization*
|
||||||
|
|
||||||
Highlighting:~
|
Highlighting:~
|
||||||
* For the |CtrlP| buffer:
|
* For the CtrlP buffer:
|
||||||
CtrlPNoEntries : the message when no match is found (Error)
|
CtrlPNoEntries : the message when no match is found (Error)
|
||||||
CtrlPMatch : the matched pattern (Identifier)
|
CtrlPMatch : the matched pattern (Identifier)
|
||||||
CtrlPLinePre : the line prefix '>' in the match window
|
CtrlPLinePre : the line prefix '>' in the match window
|
||||||
@@ -878,7 +895,10 @@ Special thanks:~
|
|||||||
===============================================================================
|
===============================================================================
|
||||||
CHANGELOG *ctrlp-changelog*
|
CHANGELOG *ctrlp-changelog*
|
||||||
|
|
||||||
+ New option: |g:ctrlp_match_func|, allow using a custom fuzzy matcher.
|
Before 2012/03/31~
|
||||||
|
|
||||||
|
+ New option: |g:ctrlp_default_input|, default input when entering CtrlP.
|
||||||
|
|g:ctrlp_match_func|, allow using a custom fuzzy matcher.
|
||||||
+ Rename:
|
+ Rename:
|
||||||
*ClearCtrlPCache* -> |CtrlPClearCache|
|
*ClearCtrlPCache* -> |CtrlPClearCache|
|
||||||
*ClearAllCtrlPCaches* -> |CtrlPClearAllCaches|
|
*ClearAllCtrlPCaches* -> |CtrlPClearAllCaches|
|
||||||
|
|||||||
@@ -8,7 +8,10 @@
|
|||||||
if ( exists('g:loaded_ctrlp') && g:loaded_ctrlp ) || v:version < 700 || &cp
|
if ( exists('g:loaded_ctrlp') && g:loaded_ctrlp ) || v:version < 700 || &cp
|
||||||
fini
|
fini
|
||||||
en
|
en
|
||||||
let [g:loaded_ctrlp, g:ctrlp_lines, g:ctrlp_allfiles] = [1, [], []]
|
let g:loaded_ctrlp = 1
|
||||||
|
|
||||||
|
let [g:ctrlp_lines, g:ctrlp_allfiles, g:ctrlp_alltags, g:ctrlp_alldirs,
|
||||||
|
\ g:ctrlp_buftags, g:ctrlp_builtins] = [[], [], [], [], {}, 2]
|
||||||
|
|
||||||
if !exists('g:ctrlp_map') | let g:ctrlp_map = '<c-p>' | en
|
if !exists('g:ctrlp_map') | let g:ctrlp_map = '<c-p>' | en
|
||||||
if !exists('g:ctrlp_cmd') | let g:ctrlp_cmd = 'CtrlP' | en
|
if !exists('g:ctrlp_cmd') | let g:ctrlp_cmd = 'CtrlP' | en
|
||||||
@@ -36,47 +39,22 @@ en
|
|||||||
|
|
||||||
cal ctrlp#mrufiles#init()
|
cal ctrlp#mrufiles#init()
|
||||||
|
|
||||||
if !exists('g:ctrlp_extensions') | fini | en
|
com! CtrlPTag cal ctrlp#init(ctrlp#tag#id())
|
||||||
|
|
||||||
let s:ext = g:ctrlp_extensions
|
com! CtrlPQuickfix cal ctrlp#init(ctrlp#quickfix#id())
|
||||||
|
|
||||||
if index(s:ext, 'tag') >= 0
|
com! -n=? -com=dir CtrlPDir cal ctrlp#init(ctrlp#dir#id(), <q-args>)
|
||||||
let g:ctrlp_alltags = []
|
|
||||||
com! CtrlPTag cal ctrlp#init(ctrlp#tag#id())
|
|
||||||
en
|
|
||||||
|
|
||||||
if index(s:ext, 'quickfix') >= 0
|
com! -n=? -com=buffer CtrlPBufTag
|
||||||
com! CtrlPQuickfix cal ctrlp#init(ctrlp#quickfix#id())
|
\ cal ctrlp#init(ctrlp#buffertag#cmd(0, <q-args>))
|
||||||
en
|
com! CtrlPBufTagAll cal ctrlp#init(ctrlp#buffertag#cmd(1))
|
||||||
|
|
||||||
if index(s:ext, 'dir') >= 0
|
com! CtrlPRTS cal ctrlp#init(ctrlp#rtscript#id())
|
||||||
let g:ctrlp_alldirs = []
|
|
||||||
com! -n=? -com=dir CtrlPDir cal ctrlp#init(ctrlp#dir#id(), <q-args>)
|
|
||||||
en
|
|
||||||
|
|
||||||
if index(s:ext, 'buffertag') >= 0
|
com! CtrlPUndo cal ctrlp#init(ctrlp#undo#id())
|
||||||
let g:ctrlp_buftags = {}
|
|
||||||
com! -n=? -com=buffer CtrlPBufTag
|
|
||||||
\ cal ctrlp#init(ctrlp#buffertag#cmd(0, <q-args>))
|
|
||||||
com! CtrlPBufTagAll cal ctrlp#init(ctrlp#buffertag#cmd(1))
|
|
||||||
en
|
|
||||||
|
|
||||||
if index(s:ext, 'rtscript') >= 0
|
com! CtrlPLine cal ctrlp#init(ctrlp#line#id())
|
||||||
com! CtrlPRTS cal ctrlp#init(ctrlp#rtscript#id())
|
|
||||||
en
|
|
||||||
|
|
||||||
if index(s:ext, 'undo') >= 0
|
com! -n=? -com=buffer CtrlPChange
|
||||||
com! CtrlPUndo cal ctrlp#init(ctrlp#undo#id())
|
\ cal ctrlp#init(ctrlp#changes#cmd(0, <q-args>))
|
||||||
en
|
com! CtrlPChangeAll cal ctrlp#init(ctrlp#changes#cmd(1))
|
||||||
|
|
||||||
if index(s:ext, 'line') >= 0
|
|
||||||
com! CtrlPLine cal ctrlp#init(ctrlp#line#id())
|
|
||||||
en
|
|
||||||
|
|
||||||
if index(s:ext, 'changes') >= 0
|
|
||||||
com! -n=? -com=buffer CtrlPChange
|
|
||||||
\ cal ctrlp#init(ctrlp#changes#cmd(0, <q-args>))
|
|
||||||
com! CtrlPChangeAll cal ctrlp#init(ctrlp#changes#cmd(1))
|
|
||||||
en
|
|
||||||
|
|
||||||
unl s:ext
|
|
||||||
|
|||||||
@@ -65,6 +65,41 @@ function! syntastic#c#GetIncludeDirs(filetype)
|
|||||||
return join(map(s:Unique(include_dirs), '"-I" . v:val'), ' ')
|
return join(map(s:Unique(include_dirs), '"-I" . v:val'), ' ')
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
" read additional compiler flags from the given configuration file
|
||||||
|
" the file format and its parsing mechanism is inspired by clang_complete
|
||||||
|
function! syntastic#c#ReadConfig(file)
|
||||||
|
" search in the current file's directory upwards
|
||||||
|
let config = findfile(a:file, '.;')
|
||||||
|
if config == '' || !filereadable(config) | return '' | endif
|
||||||
|
|
||||||
|
" convert filename into absolute path
|
||||||
|
let filepath = substitute(fnamemodify(config, ':p:h'), '\', '/', 'g')
|
||||||
|
|
||||||
|
" try to read config file
|
||||||
|
try
|
||||||
|
let lines = map(readfile(config),
|
||||||
|
\ 'substitute(v:val, ''\'', ''/'', ''g'')')
|
||||||
|
catch /E484/
|
||||||
|
return ''
|
||||||
|
endtry
|
||||||
|
|
||||||
|
let parameters = []
|
||||||
|
for line in lines
|
||||||
|
let matches = matchlist(line, '^\s*-I\s*\(\S\+\)')
|
||||||
|
if matches != [] && matches[1] != ''
|
||||||
|
" this one looks like an absolute path
|
||||||
|
if match(matches[1], '^\%(/\|\a:\)') != -1
|
||||||
|
call add(parameters, '-I' . matches[1])
|
||||||
|
else
|
||||||
|
call add(parameters, '-I' . filepath . '/' . matches[1])
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
call add(parameters, line)
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
|
|
||||||
|
return join(parameters, ' ')
|
||||||
|
endfunction
|
||||||
|
|
||||||
" search the first 100 lines for include statements that are
|
" search the first 100 lines for include statements that are
|
||||||
" given in the handlers dictionary
|
" given in the handlers dictionary
|
||||||
|
|||||||
@@ -46,6 +46,13 @@
|
|||||||
"
|
"
|
||||||
" let g:syntastic_c_compiler_options = ' -ansi'
|
" let g:syntastic_c_compiler_options = ' -ansi'
|
||||||
"
|
"
|
||||||
|
" Additionally the setting 'g:syntastic_c_config_file' allows you to define a
|
||||||
|
" file that contains additional compiler arguments like include directories or
|
||||||
|
" CFLAGS. The file is expected to contain one option per line. If none is
|
||||||
|
" given the filename defaults to '.syntastic_c_config':
|
||||||
|
"
|
||||||
|
" let g:syntastic_c_config_file = '.config'
|
||||||
|
"
|
||||||
" Using the global variable 'g:syntastic_c_remove_include_errors' you can
|
" Using the global variable 'g:syntastic_c_remove_include_errors' you can
|
||||||
" specify whether errors of files included via the g:syntastic_c_include_dirs'
|
" specify whether errors of files included via the g:syntastic_c_include_dirs'
|
||||||
" setting are removed from the result set:
|
" setting are removed from the result set:
|
||||||
@@ -68,6 +75,10 @@ if !exists('g:syntastic_c_compiler_options')
|
|||||||
let g:syntastic_c_compiler_options = '-std=gnu99'
|
let g:syntastic_c_compiler_options = '-std=gnu99'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:syntastic_c_config_file')
|
||||||
|
let g:syntastic_c_config_file = '.syntastic_c_config'
|
||||||
|
endif
|
||||||
|
|
||||||
function! SyntaxCheckers_c_GetLocList()
|
function! SyntaxCheckers_c_GetLocList()
|
||||||
let makeprg = 'gcc -fsyntax-only '
|
let makeprg = 'gcc -fsyntax-only '
|
||||||
let errorformat = '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared '.
|
let errorformat = '%-G%f:%s:,%-G%f:%l: %#error: %#(Each undeclared '.
|
||||||
@@ -113,6 +124,9 @@ function! SyntaxCheckers_c_GetLocList()
|
|||||||
let makeprg .= b:syntastic_c_cflags
|
let makeprg .= b:syntastic_c_cflags
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" add optional config file parameters
|
||||||
|
let makeprg .= syntastic#c#ReadConfig(g:syntastic_c_config_file)
|
||||||
|
|
||||||
" process makeprg
|
" process makeprg
|
||||||
let errors = SyntasticMake({ 'makeprg': makeprg,
|
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||||
\ 'errorformat': errorformat })
|
\ 'errorformat': errorformat })
|
||||||
|
|||||||
@@ -46,6 +46,13 @@
|
|||||||
"
|
"
|
||||||
" let g:syntastic_cpp_compiler_options = ' -std=c++0x'
|
" let g:syntastic_cpp_compiler_options = ' -std=c++0x'
|
||||||
"
|
"
|
||||||
|
" Additionally the setting 'g:syntastic_cpp_config_file' allows you to define
|
||||||
|
" a file that contains additional compiler arguments like include directories
|
||||||
|
" or CFLAGS. The file is expected to contain one option per line. If none is
|
||||||
|
" given the filename defaults to '.syntastic_cpp_config':
|
||||||
|
"
|
||||||
|
" let g:syntastic_cpp_config_file = '.config'
|
||||||
|
"
|
||||||
" Using the global variable 'g:syntastic_cpp_remove_include_errors' you can
|
" Using the global variable 'g:syntastic_cpp_remove_include_errors' you can
|
||||||
" specify whether errors of files included via the
|
" specify whether errors of files included via the
|
||||||
" g:syntastic_cpp_include_dirs' setting are removed from the result set:
|
" g:syntastic_cpp_include_dirs' setting are removed from the result set:
|
||||||
@@ -64,6 +71,10 @@ endif
|
|||||||
let s:save_cpo = &cpo
|
let s:save_cpo = &cpo
|
||||||
set cpo&vim
|
set cpo&vim
|
||||||
|
|
||||||
|
if !exists('g:syntastic_cpp_config_file')
|
||||||
|
let g:syntastic_cpp_config_file = '.syntastic_cpp_config'
|
||||||
|
endif
|
||||||
|
|
||||||
function! SyntaxCheckers_cpp_GetLocList()
|
function! SyntaxCheckers_cpp_GetLocList()
|
||||||
let makeprg = 'g++ -fsyntax-only '
|
let makeprg = 'g++ -fsyntax-only '
|
||||||
let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
|
let errorformat = '%-G%f:%s:,%f:%l:%c: %m,%f:%l: %m'
|
||||||
@@ -101,6 +112,9 @@ function! SyntaxCheckers_cpp_GetLocList()
|
|||||||
let makeprg .= b:syntastic_cpp_cflags
|
let makeprg .= b:syntastic_cpp_cflags
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" add optional config file parameters
|
||||||
|
let makeprg .= syntastic#c#ReadConfig(g:syntastic_cpp_config_file)
|
||||||
|
|
||||||
" process makeprg
|
" process makeprg
|
||||||
let errors = SyntasticMake({ 'makeprg': makeprg,
|
let errors = SyntasticMake({ 'makeprg': makeprg,
|
||||||
\ 'errorformat': errorformat })
|
\ 'errorformat': errorformat })
|
||||||
|
|||||||
@@ -19,11 +19,16 @@ if !executable("ghc-mod")
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if !exists('g:syntastic_haskell_checker_args')
|
||||||
|
let g:syntastic_haskell_checker_args = '--hlintOpt="--language=XmlSyntax"'
|
||||||
|
endif
|
||||||
|
|
||||||
function! SyntaxCheckers_haskell_GetLocList()
|
function! SyntaxCheckers_haskell_GetLocList()
|
||||||
|
let ghcmod = 'ghc-mod ' . g:syntastic_haskell_checker_args
|
||||||
let makeprg =
|
let makeprg =
|
||||||
\ "{ ".
|
\ "{ ".
|
||||||
\ "ghc-mod check ". shellescape(expand('%')) . "; " .
|
\ ghcmod . " check ". shellescape(expand('%')) . "; " .
|
||||||
\ "ghc-mod lint " . shellescape(expand('%')) . ";" .
|
\ ghcmod . " lint " . shellescape(expand('%')) . ";" .
|
||||||
\ " }"
|
\ " }"
|
||||||
let errorformat = '%-G\\s%#,%f:%l:%c:%trror: %m,%f:%l:%c:%tarning: %m,'.
|
let errorformat = '%-G\\s%#,%f:%l:%c:%trror: %m,%f:%l:%c:%tarning: %m,'.
|
||||||
\ '%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: %m,%f:%l:%c:%m,'.
|
\ '%f:%l:%c: %trror: %m,%f:%l:%c: %tarning: %m,%f:%l:%c:%m,'.
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ function! SyntaxCheckers_php_GetLocList()
|
|||||||
|
|
||||||
let errors = []
|
let errors = []
|
||||||
|
|
||||||
let makeprg = "php -l -d error_reporting=E_PARSE -d display_errors=0 -d error_log='' ".shellescape(expand('%'))
|
let makeprg = "php -l -d error_reporting=E_ALL -d display_errors=0 -d error_log='' ".shellescape(expand('%'))
|
||||||
let errorformat='%-GNo syntax errors detected in%.%#,PHP Parse error: %#syntax %trror\, %m in %f on line %l,PHP Fatal %trror: %m in %f on line %l,%-GErrors parsing %.%#,%-G\s%#,Parse error: %#syntax %trror\, %m in %f on line %l,Fatal %trror: %m in %f on line %l'
|
let errorformat='%-GNo syntax errors detected in%.%#,PHP Parse error: %#syntax %trror\, %m in %f on line %l,PHP Fatal %trror: %m in %f on line %l,%-GErrors parsing %.%#,%-G\s%#,Parse error: %#syntax %trror\, %m in %f on line %l,Fatal %trror: %m in %f on line %l'
|
||||||
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
let errors = SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||||
|
|
||||||
|
|||||||
@@ -26,6 +26,6 @@ endfunction
|
|||||||
|
|
||||||
function! SyntaxCheckers_python_GetLocList()
|
function! SyntaxCheckers_python_GetLocList()
|
||||||
let makeprg = 'flake8 '.g:syntastic_python_checker_args.' '.shellescape(expand('%'))
|
let makeprg = 'flake8 '.g:syntastic_python_checker_args.' '.shellescape(expand('%'))
|
||||||
let errorformat = '%E%f:%l: could not compile,%-Z%p^,%W%f:%l:%c: %m,%W%f:%l: %m,%-G%.%#'
|
let errorformat = '%E%f:%l: could not compile,%-Z%p^,%E%f:%l:%c: %m,%E%f:%l: %m,%-G%.%#'
|
||||||
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
return SyntasticMake({ 'makeprg': makeprg, 'errorformat': errorformat })
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
@@ -141,8 +141,8 @@ function! s:ParseRegex(file, settings) " {{{
|
|||||||
|
|
||||||
" Match Functions
|
" Match Functions
|
||||||
call add(patterns, ['f', '\bfunction\s+([a-zA-Z0-9_.\$]+?)\s*\(', 1])
|
call add(patterns, ['f', '\bfunction\s+([a-zA-Z0-9_.\$]+?)\s*\(', 1])
|
||||||
call add(patterns, ['f', '([a-zA-Z0-9_.\$]+?)\s*=\s*function\s*\(', 1])
|
call add(patterns, ['f', '([a-zA-Z0-9_.\$]+?)\s*=\s*\(?function\s*\(', 1])
|
||||||
call add(patterns, ['f', "\\[[\"']([A-Za-z0-9_]+)[\"']\\]\\s*=\\s*function\\s*\\(", 1])
|
call add(patterns, ['f', "\\[[\"']([A-Za-z0-9_]+)[\"']\\]\\s*=\\s*\\(?function\\s*\\(", 1])
|
||||||
|
|
||||||
" Match Members
|
" Match Members
|
||||||
call add(patterns, ['f', '\b([a-zA-Z0-9_.\$]+?)\s*:\s*function\s*\(', 1])
|
call add(patterns, ['f', '\b([a-zA-Z0-9_.\$]+?)\s*:\s*function\s*\(', 1])
|
||||||
|
|||||||
@@ -218,16 +218,35 @@ CONFIGURATION *mark-configuration*
|
|||||||
|
|
||||||
For a permanent configuration, put the following commands into your |vimrc|.
|
For a permanent configuration, put the following commands into your |vimrc|.
|
||||||
|
|
||||||
*mark-highlight-colors*
|
*mark-colors* *mark-highlight-colors*
|
||||||
You may define your own colors or more than the default 6 highlightings in
|
This plugin defines 6 mark groups:
|
||||||
your vimrc file (or anywhere before this plugin is sourced), in the following
|
1: Cyan 2:Green 3:Yellow 4:Red 5:Magenta 6:Blue ~
|
||||||
form (where N = 1..): >
|
|
||||||
highlight MarkWordN ctermbg=Cyan ctermfg=Black guibg=#8CCBEA guifg=Black
|
|
||||||
Higher numbers always take precedence and are displayed above lower ones.
|
Higher numbers always take precedence and are displayed above lower ones.
|
||||||
|
|
||||||
|
*g:mwDefaultHighlightingPalette*
|
||||||
|
Especially if you use GVIM, you can switch to a richer palette of up to 18
|
||||||
|
colors: >
|
||||||
|
let g:mwDefaultHighlightingPalette = 'extended'
|
||||||
|
<
|
||||||
|
If you like the additional colors, but don't need that many of them, restrict
|
||||||
|
their number via: >
|
||||||
|
let g:mwDefaultHighlightingNum = 9
|
||||||
|
<
|
||||||
|
*mark-colors-redefine*
|
||||||
|
If none of the default highlightings suits you, define your own colors in your
|
||||||
|
vimrc file (or anywhere before this plugin is sourced), in the following form
|
||||||
|
(where N = 1..): >
|
||||||
|
highlight MarkWordN ctermbg=Cyan ctermfg=Black guibg=#8CCBEA guifg=Black
|
||||||
|
You can also use this form to redefine only some of the default highlightings.
|
||||||
If you want to avoid losing the highlightings on |:colorscheme| commands, you
|
If you want to avoid losing the highlightings on |:colorscheme| commands, you
|
||||||
need to re-apply your highlights on the |ColorScheme| event, similar to how
|
need to re-apply your highlights on the |ColorScheme| event, similar to how
|
||||||
this plugin does.
|
this plugin does. Or you define the palette not via :highlight commands, but
|
||||||
|
use the plugin's infrastructure: >
|
||||||
|
let g:mwDefaultHighlightingPalette = [
|
||||||
|
\ { 'ctermbg':'Cyan', 'ctermfg':'Black', 'guibg':'#8CCBEA', 'guifg':'Black' },
|
||||||
|
\ ...
|
||||||
|
\]
|
||||||
|
<
|
||||||
The search type highlighting (in the search message) can be changed via: >
|
The search type highlighting (in the search message) can be changed via: >
|
||||||
highlight link SearchSpecialSearchType MoreMsg
|
highlight link SearchSpecialSearchType MoreMsg
|
||||||
<
|
<
|
||||||
@@ -299,6 +318,13 @@ http://vim.wikia.com/wiki/Highlight_multiple_words:
|
|||||||
==============================================================================
|
==============================================================================
|
||||||
HISTORY *mark-history*
|
HISTORY *mark-history*
|
||||||
|
|
||||||
|
2.6.3 27-Mar-2012
|
||||||
|
- ENH: Allow choosing of palette and limiting of default mark highlight groups
|
||||||
|
via g:mwDefaultHighlightingPalette and g:mwDefaultHighlightingNum.
|
||||||
|
- ENH: Offer an extended color palette in addition to the original 6-color one.
|
||||||
|
Enable this via :let g:mwDefaultHighlightingPalette = "extended" in your
|
||||||
|
vimrc.
|
||||||
|
|
||||||
2.6.2 26-Mar-2012
|
2.6.2 26-Mar-2012
|
||||||
- ENH: When a [count] exceeding the number of available mark groups is given,
|
- ENH: When a [count] exceeding the number of available mark groups is given,
|
||||||
a summary of marks is given and the user is asked to select a mark group.
|
a summary of marks is given and the user is asked to select a mark group.
|
||||||
|
|||||||
@@ -13,8 +13,13 @@
|
|||||||
" - Requires Vim 7.1 with "matchadd()", or Vim 7.2 or higher.
|
" - Requires Vim 7.1 with "matchadd()", or Vim 7.2 or higher.
|
||||||
" - mark.vim autoload script.
|
" - mark.vim autoload script.
|
||||||
"
|
"
|
||||||
" Version: 2.6.1
|
" Version: 2.6.3
|
||||||
" Changes:
|
" Changes:
|
||||||
|
" 27-Mar-2012, Ingo Karkat
|
||||||
|
" - ENH: Allow choosing of palette and limiting of default mark highlight groups
|
||||||
|
" via g:mwDefaultHighlightingPalette and g:mwDefaultHighlightingNum.
|
||||||
|
" - ENH: Offer an extended color palette in addition to the original 6-color one.
|
||||||
|
"
|
||||||
" 23-Mar-2012, Ingo Karkat
|
" 23-Mar-2012, Ingo Karkat
|
||||||
" - ENH: Add :Marks command that prints all mark highlight groups and their
|
" - ENH: Add :Marks command that prints all mark highlight groups and their
|
||||||
" search patterns, plus information about the current search mark, next mark
|
" search patterns, plus information about the current search mark, next mark
|
||||||
@@ -174,6 +179,8 @@ if exists('g:loaded_mark') || (v:version == 701 && ! exists('*matchadd')) || (v:
|
|||||||
finish
|
finish
|
||||||
endif
|
endif
|
||||||
let g:loaded_mark = 1
|
let g:loaded_mark = 1
|
||||||
|
let s:save_cpo = &cpo
|
||||||
|
set cpo&vim
|
||||||
|
|
||||||
"- configuration --------------------------------------------------------------
|
"- configuration --------------------------------------------------------------
|
||||||
if ! exists('g:mwHistAdd')
|
if ! exists('g:mwHistAdd')
|
||||||
@@ -188,16 +195,63 @@ if ! exists('g:mwAutoSaveMarks')
|
|||||||
let g:mwAutoSaveMarks = 1
|
let g:mwAutoSaveMarks = 1
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
if ! exists('g:mwDefaultHighlightingNum')
|
||||||
|
let g:mwDefaultHighlightingNum = -1
|
||||||
|
endif
|
||||||
|
if ! exists('g:mwDefaultHighlightingPalette')
|
||||||
|
let g:mwDefaultHighlightingPalette = 'original'
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
"- default highlightings ------------------------------------------------------
|
"- default highlightings ------------------------------------------------------
|
||||||
function! s:DefaultHighlightings()
|
function! s:DefaultHighlightings()
|
||||||
" You may define your own colors in your vimrc file, in the form as below:
|
let l:palette = []
|
||||||
highlight def MarkWord1 ctermbg=Cyan ctermfg=Black guibg=#8CCBEA guifg=Black
|
if type(g:mwDefaultHighlightingPalette) == type([])
|
||||||
highlight def MarkWord2 ctermbg=Green ctermfg=Black guibg=#A4E57E guifg=Black
|
" There are custom color definitions, not a named built-in palette.
|
||||||
highlight def MarkWord3 ctermbg=Yellow ctermfg=Black guibg=#FFDB72 guifg=Black
|
let l:palette = g:mwDefaultHighlightingPalette
|
||||||
highlight def MarkWord4 ctermbg=Red ctermfg=Black guibg=#FF7272 guifg=Black
|
elseif g:mwDefaultHighlightingPalette ==# 'original'
|
||||||
highlight def MarkWord5 ctermbg=Magenta ctermfg=Black guibg=#FFB3FF guifg=Black
|
let l:palette = [
|
||||||
highlight def MarkWord6 ctermbg=Blue ctermfg=Black guibg=#9999FF guifg=Black
|
\ { 'ctermbg':'Cyan', 'ctermfg':'Black', 'guibg':'#8CCBEA', 'guifg':'Black' },
|
||||||
|
\ { 'ctermbg':'Green', 'ctermfg':'Black', 'guibg':'#A4E57E', 'guifg':'Black' },
|
||||||
|
\ { 'ctermbg':'Yellow', 'ctermfg':'Black', 'guibg':'#FFDB72', 'guifg':'Black' },
|
||||||
|
\ { 'ctermbg':'Red', 'ctermfg':'Black', 'guibg':'#FF7272', 'guifg':'Black' },
|
||||||
|
\ { 'ctermbg':'Magenta', 'ctermfg':'Black', 'guibg':'#FFB3FF', 'guifg':'Black' },
|
||||||
|
\ { 'ctermbg':'Blue', 'ctermfg':'Black', 'guibg':'#9999FF', 'guifg':'Black' },
|
||||||
|
\]
|
||||||
|
elseif g:mwDefaultHighlightingPalette ==# 'extended'
|
||||||
|
let l:palette = [
|
||||||
|
\ { 'ctermbg':'Blue', 'ctermfg':'Black', 'guibg':'#A1B7FF', 'guifg':'#001E80' },
|
||||||
|
\ { 'ctermbg':'Magenta', 'ctermfg':'Black', 'guibg':'#FFA1C6', 'guifg':'#80005D' },
|
||||||
|
\ { 'ctermbg':'Green', 'ctermfg':'Black', 'guibg':'#ACFFA1', 'guifg':'#0F8000' },
|
||||||
|
\ { 'ctermbg':'Yellow', 'ctermfg':'Black', 'guibg':'#FFE8A1', 'guifg':'#806000' },
|
||||||
|
\ { 'ctermbg':'DarkCyan', 'ctermfg':'Black', 'guibg':'#D2A1FF', 'guifg':'#420080' },
|
||||||
|
\ { 'ctermbg':'Cyan', 'ctermfg':'Black', 'guibg':'#A1FEFF', 'guifg':'#007F80' },
|
||||||
|
\ { 'ctermbg':'DarkBlue', 'ctermfg':'Black', 'guibg':'#A1DBFF', 'guifg':'#004E80' },
|
||||||
|
\ { 'ctermbg':'DarkMagenta','ctermfg':'Black', 'guibg':'#A29CCF', 'guifg':'#120080' },
|
||||||
|
\ { 'ctermbg':'DarkRed', 'ctermfg':'Black', 'guibg':'#F5A1FF', 'guifg':'#720080' },
|
||||||
|
\ { 'ctermbg':'Brown', 'ctermfg':'Black', 'guibg':'#FFC4A1', 'guifg':'#803000' },
|
||||||
|
\ { 'ctermbg':'DarkGreen', 'ctermfg':'Black', 'guibg':'#D0FFA1', 'guifg':'#3F8000' },
|
||||||
|
\ { 'ctermbg':'Red', 'ctermfg':'Black', 'guibg':'#F3FFA1', 'guifg':'#6F8000' },
|
||||||
|
\ { 'ctermbg':'White', 'ctermfg':'Gray', 'guibg':'#E3E3D2', 'guifg':'#999999' },
|
||||||
|
\ { 'ctermbg':'LightGray', 'ctermfg':'White', 'guibg':'#D3D3C3', 'guifg':'#666666' },
|
||||||
|
\ { 'ctermbg':'Gray', 'ctermfg':'Black', 'guibg':'#A3A396', 'guifg':'#222222' },
|
||||||
|
\ { 'ctermbg':'Black', 'ctermfg':'White', 'guibg':'#53534C', 'guifg':'#DDDDDD' },
|
||||||
|
\ { 'ctermbg':'Black', 'ctermfg':'Gray', 'guibg':'#131311', 'guifg':'#AAAAAA' },
|
||||||
|
\ { 'ctermbg':'Blue', 'ctermfg':'White', 'guibg':'#0000FF', 'guifg':'#F0F0FF' },
|
||||||
|
\ { 'ctermbg':'DarkRed', 'ctermfg':'White', 'guibg':'#FF0000', 'guifg':'#FFFFFF' },
|
||||||
|
\]
|
||||||
|
elseif ! empty(g:mwDefaultHighlightingPalette)
|
||||||
|
let v:warningmsg = 'Mark: Unknown value for g:mwDefaultHighlightingPalette: ' . g:mwDefaultHighlightingPalette
|
||||||
|
echohl WarningMsg
|
||||||
|
echomsg v:warningmsg
|
||||||
|
echohl None
|
||||||
|
|
||||||
|
return
|
||||||
|
endif
|
||||||
|
|
||||||
|
for i in range(1, (g:mwDefaultHighlightingNum == -1 ? len(l:palette) : g:mwDefaultHighlightingNum))
|
||||||
|
execute 'highlight def MarkWord' . i join(map(items(l:palette[i - 1]), 'join(v:val, "=")'))
|
||||||
|
endfor
|
||||||
endfunction
|
endfunction
|
||||||
call s:DefaultHighlightings()
|
call s:DefaultHighlightings()
|
||||||
autocmd ColorScheme * call <SID>DefaultHighlightings()
|
autocmd ColorScheme * call <SID>DefaultHighlightings()
|
||||||
@@ -305,4 +359,6 @@ if g:mwAutoLoadMarks
|
|||||||
augroup END
|
augroup END
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
let &cpo = s:save_cpo
|
||||||
|
unlet s:save_cpo
|
||||||
" vim: ts=4 sts=0 sw=4 noet
|
" vim: ts=4 sts=0 sw=4 noet
|
||||||
|
|||||||
Reference in New Issue
Block a user