# HG changeset patch # User Brian Neal # Date 1325645593 21600 # Node ID 48859d9c82c536a71d3add002b0c68d2c5f8e38a Initial commit, based on settings used at work (minus NERD tree & some tagging plugins). diff -r 000000000000 -r 48859d9c82c5 vim/.vimrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/.vimrc Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,68 @@ +set nocompatible +"source $VIMRUNTIME/vimrc_example.vim +"source $VIMRUNTIME/mswin.vim +"behave mswin + +set nobackup +set tabstop=3 +set shiftwidth=3 +set backspace=indent,eol,start +set expandtab +set textwidth=120 +set number +set ruler +set history=1000 +set encoding=utf-8 + +" CtrlP related settings +set wildignore+=.git\*,.hg\*,.svn\*,*.d,*.dbo,*.o,*.ti + +" This allows % to toggle on if/elsif/else/end, XML tags, & more +runtime macros/matchit.vim + +" These two options make /-style searching case-sensitive only if there +" is a capital letter in the search expression. +set ignorecase +set smartcase + +" Sets the terminal title when run in an xterm +set title + +" This puts more context around the cursor when scrolling +set scrolloff=3 + +" let g:netrw_sort_sequence = "[\/]$,*,\.bak$,\.o$,\.info$,\.swp$,\.obj$" + +syntax on +filetype on +filetype plugin on +filetype indent on +set hlsearch +set incsearch + +" highlight trailing spaces +let c_space_errors = 1 +" let python_space_error_highlight = 1 + +colorscheme peaksea2 + +" shortcut for word completion in insert mode +imap + +" buffer next and previous commands +nnoremap :bnext +nnoremap :bprevious + +" Remove extra trailing spaces +nnoremap :%s/\s\+$// + +setlocal spell spelllang=en_us + +let mapleader="," + +" ,/ will clear any highlighted search results +nmap ,/ :let @/="" + +" NERD tree plugin +" nmap ,n :NERDTreeToggle +" let g:NERDTreeQuitOnOpen=1 diff -r 000000000000 -r 48859d9c82c5 vim/vimfiles/after/ftplugin/python.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/vimfiles/after/ftplugin/python.vim Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,4 @@ +setlocal sw=4 +setlocal ts=4 +setlocal tw=80 +let python_space_errors=1 diff -r 000000000000 -r 48859d9c82c5 vim/vimfiles/autoload/ctrlp.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/vimfiles/autoload/ctrlp.vim Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,1323 @@ +" ============================================================================= +" File: autoload/ctrlp.vim +" Description: Fuzzy file, buffer, mru and tag finder. +" Author: Kien Nguyen +" Version: 1.6.4 +" ============================================================================= + +" Static variables {{{1 +fu! s:opts() + let hst = exists('+hi') ? &hi : 20 + let opts = { + \ 'g:ctrlp_by_filename': ['s:byfname', 0], + \ 'g:ctrlp_clear_cache_on_exit': ['s:clrex', 1], + \ 'g:ctrlp_dont_split': ['s:nosplit', ''], + \ 'g:ctrlp_dotfiles': ['s:dotfiles', 1], + \ 'g:ctrlp_extensions': ['s:extensions', []], + \ 'g:ctrlp_follow_symlinks': ['s:folsym', 0], + \ 'g:ctrlp_highlight_match': ['s:mathi', [1, 'Identifier']], + \ 'g:ctrlp_lazy_update': ['s:lazy', 0], + \ 'g:ctrlp_jump_to_buffer': ['s:jmptobuf', 1], + \ 'g:ctrlp_match_window_bottom': ['s:mwbottom', 1], + \ 'g:ctrlp_match_window_reversed': ['s:mwreverse', 1], + \ 'g:ctrlp_max_depth': ['s:maxdepth', 40], + \ 'g:ctrlp_max_files': ['s:maxfiles', 20000], + \ 'g:ctrlp_max_height': ['s:mxheight', 10], + \ 'g:ctrlp_max_history': ['s:maxhst', hst], + \ 'g:ctrlp_open_multi': ['s:opmul', '1v'], + \ 'g:ctrlp_open_new_file': ['s:newfop', 3], + \ 'g:ctrlp_prompt_mappings': ['s:urprtmaps', 0], + \ 'g:ctrlp_regexp_search': ['s:regexp', 0], + \ 'g:ctrlp_root_markers': ['s:rmarkers', []], + \ 'g:ctrlp_split_window': ['s:splitwin', 0], + \ 'g:ctrlp_use_caching': ['s:caching', 1], + \ 'g:ctrlp_use_migemo': ['s:migemo', 0], + \ 'g:ctrlp_user_command': ['s:usrcmd', ''], + \ 'g:ctrlp_working_path_mode': ['s:pathmode', 2], + \ } + for [ke, va] in items(opts) + exe 'let' va[0] '=' string(exists(ke) ? eval(ke) : va[1]) + endfo + if !exists('g:ctrlp_newcache') | let g:ctrlp_newcache = 0 | en + let s:glob = s:dotfiles ? '.*\|*' : '*' + let s:maxdepth = min([s:maxdepth, 100]) + let g:ctrlp_builtins = 2 + if !empty(s:extensions) | for each in s:extensions + exe 'ru autoload/ctrlp/'.each.'.vim' + endfo | en +endf +cal s:opts() + +let s:lash = ctrlp#utils#lash() + +" Global options +let s:glbs = { 'magic': 1, 'to': 1, 'tm': 0, 'sb': 1, 'hls': 0, 'im': 0, + \ 'report': 9999, 'sc': 0, 'ss': 0, 'siso': 0, 'mfd': 200, 'mouse': 'n', + \ 'gcr': 'a:block-PmenuSel-blinkon0' } + +if s:lazy + cal extend(s:glbs, { 'ut': ( s:lazy > 1 ? s:lazy : 250 ) }) +en + +" Limiters +let [s:compare_lim, s:nocache_lim, s:mltipats_lim] = [3000, 4000, 2000] +" * Open & Close {{{1 +fu! s:Open() + let [s:cwd, s:winres] = [getcwd(), winrestcmd()] + let [s:crfile, s:crfpath] = [expand('%:p', 1), expand('%:p:h', 1)] + let [s:crword, s:crline] = [expand(''), getline('.')] + let [s:tagfiles, s:crcursor] = [s:tagfiles(), getpos('.')] + let [s:crbufnr, s:crvisual] = [bufnr('%'), s:lastvisual()] + let s:currwin = s:mwbottom ? winnr() : winnr() + has('autocmd') + sil! exe s:mwbottom ? 'bo' : 'to' '1new ControlP' + let [s:bufnr, s:prompt] = [bufnr('%'), ['', '', '']] + abc + if !exists('s:hstry') + let hst = filereadable(s:gethistloc()[1]) ? s:gethistdata() : [''] + let s:hstry = empty(hst) || !s:maxhst ? [''] : hst + en + for [ke, va] in items(s:glbs) + sil! exe 'let s:glb_'.ke.' = &'.ke.' | let &'.ke.' = '.string(va) + endfo + if s:opmul && has('signs') + sign define ctrlpmark text=+> texthl=Search + en + cal s:setupblank() +endf + +fu! s:Close() + try | bun! | cat | clo! | endt + cal s:unmarksigns() + for key in keys(s:glbs) + sil! exe 'let &'.key.' = s:glb_'.key + endfo + if exists('s:glb_acd') | let &acd = s:glb_acd | en + let [g:ctrlp_lines, g:ctrlp_allfiles] = [[], []] + exe s:winres + unl! s:focus s:hisidx s:hstgot s:marked s:statypes s:cline s:init s:savestr + \ s:crfile s:crfpath s:crword s:crvisual s:tagfiles s:crline s:crcursor + \ g:ctrlp_nolimit s:crbufnr + cal ctrlp#recordhist() + ec +endf +" * Clear caches {{{1 +fu! ctrlp#clr(...) + exe 'let g:ctrlp_new'.( exists('a:1') ? a:1 : 'cache' ).' = 1' +endf + +fu! ctrlp#clra(...) + if !exists('a:1') && ( has('dialog_gui') || has('dialog_con') ) && + \ confirm("Delete all cache files?", "&OK\n&Cancel") != 1 | retu | en + let cache_dir = ctrlp#utils#cachedir() + if isdirectory(cache_dir) + let cache_files = split(s:glbpath(cache_dir, '**', 1), "\n") + cal filter(cache_files, '!isdirectory(v:val) && v:val !~ ''\ 2 && len(items) < 30000 && !a:ispathitem ? 's:matchtab' + \ : 'match' + for item in items + if call(mfunc, [item, pat]) >= 0 | cal add(newitems, item) | en + if limit > 0 && len(newitems) >= limit | brea | en + endfo + retu newitems +endf + +fu! s:MatchedItems(items, pats, limit) + let [items, pats, limit, ipt] = [a:items, a:pats, a:limit, s:ispathitem()] + " If items is longer than s:mltipats_lim, use only the last pattern + if len(items) >= s:mltipats_lim | let pats = [pats[-1]] | en + cal map(pats, 'substitute(v:val, "\\\~", "\\\\\\~", "g")') + if !s:regexp | cal map(pats, 'escape(v:val, ".")') | en + " Loop through the patterns + for each in pats + " If newitems is small, set it as items to search in + if exists('newitems') && len(newitems) < limit + let items = copy(newitems) + en + if empty(items) " End here + retu exists('newitems') ? newitems : [] + el " Start here, go back up if have 2 or more in pats + " Loop through the items + let newitems = s:MatchIt(items, each, limit, ipt) + en + endfo + let s:matches = len(newitems) + retu newitems +endf +fu! s:SplitPattern(str, ...) "{{{1 + let str = s:sanstail(a:str) + if s:migemo && s:regexp && len(str) > 0 && executable('cmigemo') + let dict = s:glbpath(&rtp, printf("dict/%s/migemo-dict", &encoding), 1) + if !len(dict) + let dict = s:glbpath(&rtp, "dict/migemo-dict", 1) + en + if len(dict) + let [tokens, str, cmd] = [split(str, '\s'), '', 'cmigemo -v -w %s -d %s'] + for token in tokens + let rtn = system(printf(cmd, shellescape(token), shellescape(dict))) + let str .= !v:shell_error && len(rtn) > 0 ? '.*'.rtn : token + endfo + en + en + let s:savestr = str + if s:regexp || match(str, '\\\(zs\|ze\|<\|>\)\|[*|]') >= 0 + let array = [s:regexfilter(str)] + el + let array = split(str, '\zs') + if exists('+ssl') && !&ssl + cal map(array, 'substitute(v:val, "\\", "\\\\\\", "g")') + en + " Literal ^ and $ + for each in ['^', '$'] + cal map(array, 'substitute(v:val, "\\\'.each.'", "\\\\\\'.each.'", "g")') + endfo + en + " Build the new pattern + let nitem = !empty(array) ? array[0] : '' + let newpats = [nitem] + if len(array) > 1 + for item in range(1, len(array) - 1) + " Separator + let sep = exists('a:1') ? a:1 : '[^'.array[item-1].']\{-}' + let nitem .= sep.array[item] + cal add(newpats, nitem) + endfo + en + retu newpats +endf +" * BuildPrompt() {{{1 +fu! s:Render(lines, pat) + let lines = a:lines + " Setup the match window + let s:height = min([len(lines), s:mxheight]) + sil! exe '%d _ | res' s:height + " Print the new items + if empty(lines) + setl nocul + cal setline(1, ' == NO ENTRIES ==') + cal s:unmarksigns() + if s:dohighlight() | cal clearmatches() | en + retu + en + setl cul + " Sort if not MRU + if ( s:itemtype != 2 && !exists('g:ctrlp_nolimit') ) + \ || !empty(join(s:prompt, '')) + let s:compat = a:pat + cal sort(lines, 's:mixedsort') + unl s:compat + en + if s:mwreverse | cal reverse(lines) | en + let s:matched = copy(lines) + cal map(lines, 'substitute(v:val, "^", "> ", "")') + cal setline(1, lines) + exe 'keepj norm!' s:mwreverse ? 'G' : 'gg' + keepj norm! 1| + cal s:unmarksigns() + cal s:remarksigns() + if exists('s:cline') | cal cursor(s:cline, 1) | en + " Highlighting + if s:dohighlight() + cal s:highlight(a:pat, empty(s:mathi[1]) ? 'Identifier' : s:mathi[1]) + en +endf + +fu! s:Update(str) + " Get the previous string if existed + let oldstr = exists('s:savestr') ? s:savestr : '' + let pats = s:SplitPattern(a:str) + " Get the new string sans tail + let notail = substitute(a:str, ':\([^:]\|\\:\)*$', '', 'g') + " Stop if the string's unchanged + if notail == oldstr && !empty(notail) && !exists('s:force') + retu + en + let lines = exists('g:ctrlp_nolimit') && empty(notail) ? copy(g:ctrlp_lines) + \ : s:MatchedItems(g:ctrlp_lines, pats, s:mxheight) + cal s:Render(lines, pats[-1]) +endf + +fu! s:ForceUpdate() + let [estr, prt] = ['"\', copy(s:prompt)] + cal map(prt, 'escape(v:val, estr)') + cal s:Update(join(prt, '')) +endf + +fu! s:BuildPrompt(upd, ...) + let base = ( s:regexp ? 'r' : '>' ).( s:byfname ? 'd' : '>' ).'> ' + let [estr, prt] = ['"\', copy(s:prompt)] + cal map(prt, 'escape(v:val, estr)') + let str = join(prt, '') + let lazy = empty(str) || exists('s:force') || !has('autocmd') ? 0 : s:lazy + if a:upd && ( s:matches || s:regexp || match(str, '[*|]') >= 0 ) && !lazy + sil! cal s:Update(str) + en + sil! cal ctrlp#statusline() + " Toggling + let [hiactive, hicursor, base] = exists('a:1') && !a:1 + \ ? ['Comment', 'Comment', tr(base, '>', '-')] + \ : ['Normal', 'Constant', base] + let hibase = 'Comment' + " Build it + redr + exe 'echoh' hibase '| echon "'.base.'" + \ | echoh' hiactive '| echon "'.prt[0].'" + \ | echoh' hicursor '| echon "'.prt[1].'" + \ | echoh' hiactive '| echon "'.prt[2].'" | echoh None' + " Append the cursor at the end + if empty(prt[1]) && ( !exists('a:1') || ( exists('a:1') && a:1 ) ) + exe 'echoh' hibase '| echon "_" | echoh None' + en +endf +" ** Prt Actions {{{1 +" Editing {{{2 +fu! s:PrtClear() + unl! s:hstgot + let [s:prompt, s:matches] = [['', '', ''], 1] + cal s:BuildPrompt(1) +endf + +fu! s:PrtAdd(char) + unl! s:hstgot + let s:prompt[0] = s:prompt[0] . a:char + cal s:BuildPrompt(1) +endf + +fu! s:PrtBS() + unl! s:hstgot + let [prt, s:matches] = [s:prompt, 1] + let prt[0] = strpart(prt[0], -1, strlen(prt[0])) + cal s:BuildPrompt(1) +endf + +fu! s:PrtDelete() + unl! s:hstgot + let [prt, s:matches] = [s:prompt, 1] + let prt[1] = strpart(prt[2], 0, 1) + let prt[2] = strpart(prt[2], 1) + cal s:BuildPrompt(1) +endf + +fu! s:PrtDeleteWord() + unl! s:hstgot + let [str, s:matches] = [s:prompt[0], 1] + let str = match(str, '\W\w\+$') >= 0 ? matchstr(str, '^.\+\W\ze\w\+$') + \ : match(str, '\w\W\+$') >= 0 ? matchstr(str, '^.\+\w\ze\W\+$') + \ : match(str, '\s\+$') >= 0 ? matchstr(str, '^.*[^ \t]\+\ze\s\+$') + \ : match(str, ' ') <= 0 ? '' : str + let s:prompt[0] = str + cal s:BuildPrompt(1) +endf + +fu! s:PrtInsert(type) + unl! s:hstgot + " Insert current word, search register, last visual and clipboard + let s:prompt[0] .= a:type == 'w' ? s:crword + \ : a:type == 's' ? getreg('/') + \ : a:type == 'v' ? s:crvisual + \ : a:type == '+' ? substitute(getreg('+'), '\n', '\\n', 'g') : s:prompt[0] + cal s:BuildPrompt(1) +endf +" Movement {{{2 +fu! s:PrtCurLeft() + if !empty(s:prompt[0]) + let prt = s:prompt + let prt[2] = prt[1] . prt[2] + let prt[1] = strpart(prt[0], strlen(prt[0]) - 1) + let prt[0] = strpart(prt[0], -1, strlen(prt[0])) + en + cal s:BuildPrompt(0) +endf + +fu! s:PrtCurRight() + let prt = s:prompt + let prt[0] = prt[0] . prt[1] + let prt[1] = strpart(prt[2], 0, 1) + let prt[2] = strpart(prt[2], 1) + cal s:BuildPrompt(0) +endf + +fu! s:PrtCurStart() + let prt = s:prompt + let str = join(prt, '') + let [prt[0], prt[1], prt[2]] = ['', strpart(str, 0, 1), strpart(str, 1)] + cal s:BuildPrompt(0) +endf + +fu! s:PrtCurEnd() + let prt = s:prompt + let [prt[0], prt[1], prt[2]] = [join(prt, ''), '', ''] + cal s:BuildPrompt(0) +endf + +fu! s:PrtSelectMove(dir) + exe 'norm!' a:dir + let s:cline = line('.') + if line('$') > winheight(0) | cal s:BuildPrompt(0, s:Focus()) | en +endf + +fu! s:PrtSelectJump(char, ...) + let lines = copy(s:matched) + if exists('a:1') + cal map(lines, 'split(v:val, ''[\/]\ze[^\/]\+$'')[-1]') + en + " Cycle through matches, use s:jmpchr to store last jump + let chr = escape(a:char, '.~') + if match(lines, '\c^'.chr) >= 0 + " If not exists or does but not for the same char + let pos = match(lines, '\c^'.chr) + if !exists('s:jmpchr') || ( exists('s:jmpchr') && s:jmpchr[0] != chr ) + let [jmpln, s:jmpchr] = [pos, [chr, pos]] + elsei exists('s:jmpchr') && s:jmpchr[0] == chr + " Start of lines + if s:jmpchr[1] == -1 | let s:jmpchr[1] = pos | en + let npos = match(lines, '\c^'.chr, s:jmpchr[1] + 1) + let [jmpln, s:jmpchr] = [npos == -1 ? pos : npos, [chr, npos]] + en + keepj exe jmpln + 1 + let s:cline = line('.') + if line('$') > winheight(0) | cal s:BuildPrompt(0, s:Focus()) | en + en +endf +" Misc {{{2 +fu! s:PrtClearCache() + if s:itemtype == 1 | retu | en + if s:itemtype == 0 + cal ctrlp#clr() + elsei s:itemtype > 2 + cal ctrlp#clr(s:statypes[s:itemtype][1]) + en + if s:itemtype == 2 + let g:ctrlp_lines = ctrlp#mrufiles#list(-1, 1) + el + cal s:SetLines(s:itemtype) + en + let s:force = 1 + cal s:BuildPrompt(1) + unl s:force +endf + +fu! s:PrtDeleteMRU() + if s:itemtype == 2 + let s:force = 1 + let g:ctrlp_lines = ctrlp#mrufiles#list(-1, 2) + cal s:BuildPrompt(1) + unl s:force + en +endf + +fu! s:PrtExit() + if !has('autocmd') | cal s:Close() | en + exe s:currwin.'winc w' +endf + +fu! s:PrtHistory(...) + if !s:maxhst | retu | en + let [str, hst, s:matches] = [join(s:prompt, ''), s:hstry, 1] + " Save to history if not saved before + let [hst[0], hslen] = [exists('s:hstgot') ? hst[0] : str, len(hst)] + let idx = exists('s:hisidx') ? s:hisidx + a:1 : a:1 + " Limit idx within 0 and hslen + let idx = idx < 0 ? 0 : idx >= hslen ? hslen > 1 ? hslen - 1 : 0 : idx + let s:prompt = [hst[idx], '', ''] + let [s:hisidx, s:hstgot, s:force] = [idx, 1, 1] + cal s:BuildPrompt(1) + unl s:force +endf +"}}}1 +" * MapKeys() {{{1 +fu! s:MapKeys(...) + " Normal keys + let pfunc = exists('a:1') && !a:1 ? 'PrtSelectJump' : 'PrtAdd' + let dojmp = s:byfname && pfunc == 'PrtSelectJump' ? ', 1' : '' + for each in range(32, 126) + let cmd = "nn \ \ \ :\cal \%s(\"%s\"%s)\" + exe printf(cmd, each, pfunc, escape(nr2char(each), '"|\'), dojmp) + endfo + if exists('a:2') | retu | en + " Special keys + cal call('s:MapSpecs', exists('a:1') && !a:1 ? [1] : []) +endf + +fu! s:MapSpecs(...) + let [lcmap, prtmaps] = ['nn ', { + \ 'PrtBS()': [''], + \ 'PrtDelete()': [''], + \ 'PrtDeleteWord()': [''], + \ 'PrtClear()': [''], + \ 'PrtSelectMove("j")': ['', ''], + \ 'PrtSelectMove("k")': ['', ''], + \ 'PrtHistory(-1)': [''], + \ 'PrtHistory(1)': [''], + \ 'AcceptSelection("e")': ['', '<2-LeftMouse>'], + \ 'AcceptSelection("h")': ['', '', ''], + \ 'AcceptSelection("t")': ['', ''], + \ 'AcceptSelection("v")': ['', '', ''], + \ 'ToggleFocus()': [''], + \ 'ToggleRegex()': [''], + \ 'ToggleByFname()': [''], + \ 'ToggleType(1)': ['', '', ''], + \ 'PrtInsert("w")': [''], + \ 'PrtInsert("s")': [''], + \ 'PrtInsert("v")': [''], + \ 'PrtInsert("+")': [''], + \ 'PrtCurStart()': [''], + \ 'PrtCurEnd()': [''], + \ 'PrtCurLeft()': ['', ''], + \ 'PrtCurRight()': ['', ''], + \ 'PrtClearCache()': [''], + \ 'PrtDeleteMRU()': [''], + \ 'CreateNewFile()': [''], + \ 'MarkToOpen()': [''], + \ 'OpenMulti()': [''], + \ 'PrtExit()': ['', '', ''], + \ }] + if type(s:urprtmaps) == 4 + cal extend(prtmaps, s:urprtmaps) + en + " Correct arrow keys in terminal + if ( has('termresponse') && !empty(v:termresponse) ) + \ || &term =~? 'xterm\|\','\B ','\C ','\D '] + exe lcmap.' ['.each + endfo + en + if exists('a:1') + let prtunmaps = [ + \ 'PrtBS()', + \ 'PrtDelete()', + \ 'PrtDeleteWord()', + \ 'PrtClear()', + \ 'PrtCurStart()', + \ 'PrtCurEnd()', + \ 'PrtCurLeft()', + \ 'PrtCurRight()', + \ 'PrtHistory(-1)', + \ 'PrtHistory(1)', + \ 'PrtInsert("w")', + \ 'PrtInsert("s")', + \ 'PrtInsert("v")', + \ 'PrtInsert("+")', + \ ] + for ke in prtunmaps | for kp in prtmaps[ke] + exe lcmap kp '' + endfo | endfo + el + for [ke, va] in items(prtmaps) | for kp in va + exe lcmap kp ':cal '.ke.'' + endfo | endfo + en +endf +" * Toggling {{{1 +fu! s:Focus() + retu !exists('s:focus') ? 1 : s:focus +endf + +fu! s:ToggleFocus() + let s:focus = !exists('s:focus') || s:focus ? 0 : 1 + cal s:MapKeys(s:focus) + cal s:BuildPrompt(0, s:focus) +endf + +fu! s:ToggleRegex() + let s:regexp = s:regexp ? 0 : 1 + cal s:PrtSwitcher() +endf + +fu! s:ToggleByFname() + if s:ispathitem() + let s:byfname = s:byfname ? 0 : 1 + cal s:MapKeys(s:Focus(), 1) + cal s:PrtSwitcher() + en +endf + +fu! s:ToggleType(dir) + let ext = exists('g:ctrlp_ext_vars') ? len(g:ctrlp_ext_vars) : 0 + let s:itemtype = s:walker(g:ctrlp_builtins + ext, s:itemtype, a:dir) + let s:extid = s:itemtype - ( g:ctrlp_builtins + 1 ) + unl! g:ctrlp_nolimit + cal s:SetLines(s:itemtype) + cal s:PrtSwitcher() + if s:itemtype > 2 + if exists('g:ctrlp_ext_vars['.s:extid.'][4][0]') + let g:ctrlp_nolimit = g:ctrlp_ext_vars[s:extid][4][0] + en + el + cal s:syntax() + en +endf + +fu! s:PrtSwitcher() + let [s:force, s:matches] = [1, 1] + cal s:BuildPrompt(1, s:Focus()) + unl s:force +endf +fu! s:SetWD(...) "{{{1 + let pathmode = s:pathmode + if exists('a:1') && len(a:1) | if type(a:1) + cal ctrlp#setdir(a:1) | retu + el + let pathmode = a:1 + en | en + if !exists('a:2') + if match(s:crfile, '^\<.\+\>://.*') >= 0 || !pathmode | retu | en + if exists('+acd') | let [s:glb_acd, &acd] = [&acd, 0] | en + cal ctrlp#setdir(s:crfpath) + en + if pathmode == 1 | retu | en + let markers = ['root.dir','.git/','.hg/','.vimprojects','_darcs/','.bzr/'] + if type(s:rmarkers) == 3 && !empty(s:rmarkers) + cal extend(markers, s:rmarkers, 0) + en + for marker in markers + cal s:findroot(getcwd(), marker, 0, 0) + if exists('s:foundroot') | brea | en + endfo + unl! s:foundroot +endf +" * AcceptSelection() {{{1 +fu! ctrlp#acceptfile(mode, matchstr, ...) + let [md, matchstr] = [a:mode, a:matchstr] + " Get the full path + let filpath = s:itemtype ? matchstr : getcwd().s:lash.matchstr + cal s:PrtExit() + let bufnum = bufnr(filpath) + if s:jmptobuf && bufnum > 0 && md == 'e' + let [jmpb, bufwinnr] = [1, bufwinnr(bufnum)] + let buftab = s:jmptobuf > 1 ? s:buftab(bufnum) : [0, 0] + let j2l = a:0 ? a:1 : str2nr(matchstr(s:tail(), '^ +\zs\d\+$')) + en + " Switch to existing buffer or open new one + if exists('jmpb') && buftab[0] + exe 'tabn' buftab[1] + exe buftab[0].'winc w' + if j2l | cal s:j2l(j2l) | en + elsei exists('jmpb') && bufwinnr > 0 + exe bufwinnr.'winc w' + if j2l | cal s:j2l(j2l) | en + el + " Determine the command to use + let cmd = md == 't' || s:splitwin == 1 ? 'tabe' + \ : md == 'h' || s:splitwin == 2 ? 'new' + \ : md == 'v' || s:splitwin == 3 ? 'vne' : ctrlp#normcmd('e') + " Open new window/buffer + cal call('s:openfile', a:0 ? [cmd, filpath, ' +'.a:1] : [cmd, filpath]) + en +endf + +fu! s:AcceptSelection(mode) + if a:mode == 'e' | if s:specinputs() | retu | en | en + " Get the selected line + let matchstr = matchstr(getline('.'), '^> \zs.\+\ze\t*$') + if empty(matchstr) | retu | en + " Do something with it + let actfunc = s:itemtype =~ '0\|1\|2' ? 'ctrlp#acceptfile' + \ : g:ctrlp_ext_vars[s:itemtype - ( g:ctrlp_builtins + 1 )][1] + cal call(actfunc, [a:mode, matchstr]) +endf +fu! s:CreateNewFile() "{{{1 + let str = join(s:prompt, '') + if empty(str) | retu | en + let str = s:sanstail(str) + let arr = split(str, '[\/]') + let fname = remove(arr, -1) + if len(arr) | if isdirectory(s:createparentdirs(arr)) + let optyp = str + en | el + let optyp = fname + en + if exists('optyp') + let filpath = getcwd().s:lash.optyp + cal s:insertcache(str) + cal s:PrtExit() + let cmd = s:newfop == 1 ? 'tabe' + \ : s:newfop == 2 ? 'new' + \ : s:newfop == 3 ? 'vne' : ctrlp#normcmd('e') + cal s:openfile(cmd, filpath) + en +endf +" * OpenMulti() {{{1 +fu! s:MarkToOpen() + if s:bufnr <= 0 || !s:opmul || s:itemtype > g:ctrlp_builtins | retu | en + let matchstr = matchstr(getline('.'), '^> \zs.\+\ze\t*$') + if empty(matchstr) | retu | en + let filpath = s:itemtype ? matchstr : getcwd().s:lash.matchstr + if exists('s:marked') && s:dictindex(s:marked, filpath) > 0 + " Unmark and remove the file from s:marked + let key = s:dictindex(s:marked, filpath) + cal remove(s:marked, key) + if empty(s:marked) | unl! s:marked | en + if has('signs') + exe 'sign unplace' key 'buffer='.s:bufnr + en + el + " Add to s:marked and place a new sign + if exists('s:marked') + let vac = s:vacantdict(s:marked) + let key = empty(vac) ? len(s:marked) + 1 : vac[0] + let s:marked = extend(s:marked, { key : filpath }) + el + let [key, s:marked] = [1, { 1 : filpath }] + en + if has('signs') + exe 'sign place' key 'line='.line('.').' name=ctrlpmark buffer='.s:bufnr + en + en + sil! cal ctrlp#statusline() +endf + +fu! s:OpenMulti() + if !exists('s:marked') || !s:opmul + cal s:AcceptSelection('e') + retu + en + let mkd = s:marked + cal s:PrtExit() + " Try not to open a new tab + let [ntab, norwins] = [0, s:normbuf()] + if empty(norwins) | let ntab = 1 | el + for each in norwins + let bufnr = winbufnr(each) + if !empty(bufname(bufnr)) && !empty(getbufvar(bufnr, '&ft')) + \ && bufname(bufnr) != 'ControlP' + let ntab = 1 + en + endfo + if !ntab | let wnr = min(norwins) | en + en + if ntab | tabnew | en + let [ic, wnr] = [1, exists('wnr') ? wnr : 1] + let cmds = { 'v': 'vne', 'h': 'new', 't': 'tabe' } + let spt = len(s:opmul) > 1 ? cmds[matchstr(s:opmul, '\w$')] : 'vne' + let nr = matchstr(s:opmul, '^\d\+') + exe wnr.'winc w' + for [ke, va] in items(mkd) + let cmd = ic == 1 ? 'e' : spt + cal s:openfile(cmd, va) + if nr > 1 && nr < ic | clo! | el | let ic += 1 | en + endfo +endf +" ** Helper functions {{{1 +" Sorting {{{2 +fu! ctrlp#complen(s1, s2) + " By length + let [len1, len2] = [strlen(a:s1), strlen(a:s2)] + retu len1 == len2 ? 0 : len1 > len2 ? 1 : -1 +endf + +fu! s:compmatlen(s1, s2) + " By match length + let mln1 = s:shortest(s:matchlens(a:s1, s:compat)) + let mln2 = s:shortest(s:matchlens(a:s2, s:compat)) + retu mln1 == mln2 ? 0 : mln1 > mln2 ? 1 : -1 +endf + +fu! s:comptime(s1, s2) + " By last modified time + let [time1, time2] = [getftime(a:s1), getftime(a:s2)] + retu time1 == time2 ? 0 : time1 < time2 ? 1 : -1 +endf + +fu! s:comparent(s1, s2) + " By same parent dir + if match(s:crfpath, escape(getcwd(), '.^$*\')) >= 0 + let [as1, as2] = [getcwd().s:lash.a:s1, getcwd().s:lash.a:s2] + let [loc1, loc2] = [s:getparent(as1), s:getparent(as2)] + if loc1 == s:crfpath && loc2 != s:crfpath | retu -1 | en + if loc2 == s:crfpath && loc1 != s:crfpath | retu 1 | en + retu 0 + en + retu 0 +endf + +fu! s:matchlens(str, pat, ...) + if empty(a:pat) || index(['^','$'], a:pat) >= 0 | retu {} | en + let st = exists('a:1') ? a:1 : 0 + let lens = exists('a:2') ? a:2 : {} + let nr = exists('a:3') ? a:3 : 0 + if match(a:str, a:pat, st) != -1 + let [mst, mnd] = [matchstr(a:str, a:pat, st), matchend(a:str, a:pat, st)] + let lens = extend(lens, { nr : [len(mst), mst] }) + let lens = s:matchlens(a:str, a:pat, mnd, lens, nr + 1) + en + retu lens +endf + +fu! s:shortest(lens) + retu min(map(values(a:lens), 'v:val[0]')) +endf + +fu! s:mixedsort(s1, s2) + let [cml, cln] = [s:compmatlen(a:s1, a:s2), ctrlp#complen(a:s1, a:s2)] + if s:itemtype < 3 && s:height < 51 + let par = s:comparent(a:s1, a:s2) + if s:height < 21 + retu 6 * cml + 3 * par + 2 * s:comptime(a:s1, a:s2) + cln + en + retu 3 * cml + 2 * par + cln + en + retu 2 * cml + cln +endf +" Statusline {{{2 +fu! ctrlp#statusline(...) + if !exists('s:statypes') + let s:statypes = [ + \ ['files', 'fil'], + \ ['buffers', 'buf'], + \ ['mru files', 'mru'], + \ ] + if exists('g:ctrlp_ext_vars') + cal map(copy(g:ctrlp_ext_vars), 'add(s:statypes, [ v:val[2], v:val[3] ])') + en + en + let tps = s:statypes + let max = len(tps) - 1 + let nxt = tps[s:walker(max, s:itemtype, 1)][1] + let prv = tps[s:walker(max, s:itemtype, -1)][1] + let item = tps[s:itemtype][0] + let focus = s:Focus() ? 'prt' : 'win' + let byfname = s:byfname ? 'file' : 'path' + let regex = s:regexp ? '%#LineNr# regex %*' : '' + let focus = '%#LineNr# '.focus.' %*' + let byfname = '%#Character# '.byfname.' %*' + let item = '%#Character# '.item.' %*' + let slider = ' <'.prv.'>={'.item.'}=<'.nxt.'>' + let dir = ' %=%<%#LineNr# '.getcwd().' %*' + let marked = s:opmul ? exists('s:marked') ? ' <'.s:dismrk().'>' : ' <+>' : '' + let &l:stl = focus.byfname.regex.slider.marked.dir +endf + +fu! s:dismrk() + retu has('signs') ? '+'.len(s:marked) : + \ '%<'.join(values(map(copy(s:marked), 'split(v:val, "[\\/]")[-1]')), ', ') +endf + +fu! ctrlp#progress(len) + if has('macunix') || has('mac') | sl 1m | en + let &l:stl = '%#Function# '.a:len.' %* %=%<%#LineNr# '.getcwd().' %*' + redr +endf +" Paths {{{2 +fu! ctrlp#dirfilter(val) + retu isdirectory(a:val) && match(a:val, '[\/]\.\{,2}$') < 0 ? 1 : 0 +endf + +fu! s:ispathitem() + let ext = s:itemtype - ( g:ctrlp_builtins + 1 ) + if s:itemtype < 3 || ( s:itemtype > 2 && g:ctrlp_ext_vars[ext][3] == 'dir' ) + retu 1 + en + retu 0 +endf + +fu! ctrlp#rmbasedir(items) + let path = &ssl || !exists('+ssl') ? getcwd().'/' : + \ substitute(getcwd(), '\\', '\\\\', 'g').'\\' + retu map(a:items, 'substitute(v:val, path, "", "g")') +endf + +fu! s:parentdir(curr) + let parent = s:getparent(a:curr) + if parent != a:curr | cal ctrlp#setdir(parent) | en +endf + +fu! s:getparent(item) + retu split(a:item, '[\/]\ze[^\/]\+[\/:]\?$')[0] +endf + +fu! s:getgrand(item) + retu split(a:item, '[\/]\ze[^\/]\+[\/][^\/]\+[\/:]\?$')[0] +endf + +fu! s:createparentdirs(arr) + for each in a:arr + let curr = exists('curr') ? curr.s:lash.each : each + cal ctrlp#utils#mkdir(curr) + endfo + retu curr +endf + +fu! s:listdirs(path, parent) + let [str, dirs] = ['', split(s:glbpath(a:path, '*', 1), "\n")] + for entry in filter(dirs, 'isdirectory(v:val)') + let str .= a:parent . split(entry, '[\/]')[-1] . "\n" + endfo + retu str +endf + +fu! ctrlp#cpl(A, L, P) + let haslash = match(a:A, '[\/]') + let parent = substitute(a:A, '[^\/]*$', '', 'g') + let path = !haslash ? parent : haslash > 0 ? getcwd().s:lash.parent : getcwd() + retu s:listdirs(path, parent) +endf + +fu! s:findroot(curr, mark, depth, type) + let [depth, notfound] = [a:depth + 1, empty(s:glbpath(a:curr, a:mark, 1))] + if !notfound || depth > s:maxdepth + if notfound | cal ctrlp#setdir(s:cwd) | en + if a:type + let s:vcsroot = depth <= s:maxdepth ? a:curr : '' + el + cal ctrlp#setdir(a:curr) + let s:foundroot = 1 + en + el + let parent = s:getparent(a:curr) + if parent != a:curr | cal s:findroot(parent, a:mark, depth, a:type) | en + en +endf + +fu! s:glbpath(...) + retu call('globpath', v:version > 701 ? a:000 : a:000[:1]) +endf + +fu! ctrlp#fnesc(path) + retu exists('*fnameescape') ? fnameescape(a:path) : escape(a:path, " %#*?|<\"\n") +endf + +fu! ctrlp#setdir(path, ...) + let cmd = exists('a:1') ? a:1 : 'lc!' + try + exe cmd.' '.ctrlp#fnesc(a:path) + cat + cal ctrlp#msg("Can't change working dir. Directory not exists.") + endt +endf +" Highlighting {{{2 +fu! s:syntax() + sy match CtrlPNoEntries '^ == NO ENTRIES ==$' + sy match CtrlPLineMarker '^>' + hi link CtrlPNoEntries Error + hi CtrlPLineMarker guifg=bg +endf + +fu! s:highlight(pat, grp) + cal clearmatches() + if !empty(a:pat) && a:pat != '..' && s:itemtype < 3 + let pat = substitute(a:pat, '\~', '\\~', 'g') + if !s:regexp | let pat = escape(pat, '.') | en + " Match only filename + if s:byfname + let pat = substitute(pat, '\[\^\(.\{-}\)\]\\{-}', '[^\\/\1]\\{-}', 'g') + let pat = substitute(pat, '$', '\\ze[^\\/]*$', 'g') + en + cal matchadd(a:grp, '\c'.pat) + cal matchadd('CtrlPLineMarker', '^>') + en +endf + +fu! s:dohighlight() + retu type(s:mathi) == 3 && len(s:mathi) == 2 && s:mathi[0] + \ && exists('*clearmatches') +endf +" Prompt history {{{2 +fu! s:gethistloc() + let cache_dir = ctrlp#utils#cachedir().s:lash.'hist' + retu [cache_dir, cache_dir.s:lash.'cache.txt'] +endf + +fu! s:gethistdata() + retu ctrlp#utils#readfile(s:gethistloc()[1]) +endf + +fu! ctrlp#recordhist() + let str = join(s:prompt, '') + if empty(str) || !s:maxhst | retu | en + let hst = s:hstry + if len(hst) > 1 && hst[1] == str | retu | en + cal extend(hst, [str], 1) + if len(hst) > s:maxhst | cal remove(hst, s:maxhst, -1) | en +endf +" Signs {{{2 +fu! s:unmarksigns() + if !s:dosigns() | retu | en + for key in keys(s:marked) + exe 'sign unplace' key 'buffer='.s:bufnr + endfo +endf + +fu! s:remarksigns() + if !s:dosigns() | retu | en + let nls = s:matched + for ic in range(1, len(nls)) + let filpath = s:itemtype ? nls[ic - 1] : getcwd().s:lash.nls[ic - 1] + let key = s:dictindex(s:marked, filpath) + if key > 0 + exe 'sign place' key 'line='.ic.' name=ctrlpmark buffer='.s:bufnr + en + endfo +endf + +fu! s:dosigns() + retu exists('s:marked') && s:bufnr > 0 && s:opmul && has('signs') +endf +" Dictionaries {{{2 +fu! s:dictindex(dict, expr) + for key in keys(a:dict) + if a:dict[key] == a:expr | retu key | en + endfo + retu -1 +endf + +fu! s:vacantdict(dict) + retu filter(range(1, max(keys(a:dict))), '!has_key(a:dict, v:val)') +endf +" Buffers {{{2 +fu! s:buftab(bufnum) + for nr in range(1, tabpagenr('$')) + let buflist = tabpagebuflist(nr) + if match(buflist, a:bufnum) >= 0 + let [buftabnr, tabwinnrs] = [nr, tabpagewinnr(nr, '$')] + for ewin in range(1, tabwinnrs) + if buflist[ewin - 1] == a:bufnum + retu [ewin, buftabnr] + en + endfo + en + endfo + retu [0, 0] +endf + +fu! s:normbuf() + let winnrs = [] + for each in range(1, winnr('$')) + let bufnr = winbufnr(each) + if getbufvar(bufnr, '&bl') && empty(getbufvar(bufnr, '&bt')) + \ && getbufvar(bufnr, '&ma') + cal add(winnrs, each) + en + endfo + retu winnrs +endf + +fu! ctrlp#normcmd(cmd) + if !empty(s:nosplit) && match([bufname('%'), &l:ft], s:nosplit) >= 0 + retu a:cmd + en + " Find a regular buffer + let norwins = s:normbuf() + let norwin = empty(norwins) ? 0 : norwins[0] + if norwin + if index(norwins, winnr()) < 0 + exe norwin.'winc w' + en + retu a:cmd + en + retu 'bo vne' +endf + +fu! s:setupblank() + setl noswf nobl nonu nowrap nolist nospell nocuc wfh + setl fdc=0 fdl=99 tw=0 bt=nofile bh=unload + if v:version >= 703 + setl nornu noudf cc=0 + en +endf + +fu! s:leavepre() + if s:clrex && ( !has('clientserver') || + \ ( has('clientserver') && len(split(serverlist(), "\n")) == 1 ) ) + cal ctrlp#clra(1) + en + cal ctrlp#utils#writecache(s:hstry, s:gethistloc()[0], s:gethistloc()[1]) +endf + +fu! s:checkbuf() + if exists('s:init') | retu | en + if exists('s:bufnr') && s:bufnr > 0 + exe s:bufnr.'bw!' + en +endf +" Arguments {{{2 +fu! s:tail() + if exists('s:optail') && !empty('s:optail') + let tailpref = match(s:optail, '^\s*+') < 0 ? ' +' : ' ' + retu tailpref.s:optail + en + retu '' +endf + +fu! s:sanstail(str) + " Restore the number of backslashes + let str = substitute(a:str, '\\\\', '\', 'g') + unl! s:optail + if match(str, ':\([^:]\|\\:\)*$') >= 0 + let s:optail = matchstr(str, ':\zs\([^:]\|\\:\)*$') + retu substitute(str, ':\([^:]\|\\:\)*$', '', 'g') + en + retu str +endf +" Misc {{{2 +fu! s:specinputs() + let str = join(s:prompt, '') + let type = s:itemtype > 2 ? + \ g:ctrlp_ext_vars[s:itemtype - ( g:ctrlp_builtins + 1 )][3] : s:itemtype + if str == '..' && type =~ '0\|dir' + cal s:parentdir(getcwd()) + cal s:SetLines(s:itemtype) + cal s:PrtClear() + retu 1 + elsei ( str == '/' || str == '\' ) && type =~ '0\|dir' + cal s:SetWD(2, 0) + cal s:SetLines(s:itemtype) + cal s:PrtClear() + retu 1 + elsei str == '?' + cal s:PrtExit() + let hlpwin = &columns > 159 ? '| vert res 80' : '' + sil! exe 'bo vert h ctrlp-mappings' hlpwin '| norm! 0' + retu 1 + en + retu 0 +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! ctrlp#msg(msg) + echoh Identifier | echon "CtrlP: ".a:msg | echoh None +endf + +fu! s:openfile(cmd, filpath, ...) + let cmd = a:cmd == 'e' && &modified ? 'hid e' : a:cmd + let tail = a:0 ? a:1 : s:tail() + try + exe cmd.tail.' '.ctrlp#fnesc(a:filpath) + cat + cal ctrlp#msg("Operation can't be completed. Make sure filename is valid.") + fina + if !empty(tail) + sil! norm! zOzz + en + endt +endf + +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! s:j2l(nr) + exe a:nr + sil! norm! zOzz +endf + +fu! s:regexfilter(str) + let str = a:str + let pats = { + \ '^\(\\|\)\|\(\\|\)$': '\\|', + \ '^\\\(zs\|ze\|<\|>\)': '^\\\(zs\|ze\|<\|>\)', + \ '^\S\*$': '\*', + \ '^\S\\?$': '\\?', + \ } + for key in keys(pats) | if match(str, key) >= 0 + let str = substitute(str, pats[key], '', 'g') + en | endfo + retu str +endf + +fu! s:walker(max, pos, dir) + retu a:dir > 0 ? a:pos < a:max ? a:pos + 1 : 0 : a:pos > 0 ? a:pos - 1 : a:max +endf + +fu! s:matchfname(item, pat) + retu match(split(a:item, '[\/]\ze[^\/]\+$')[-1], a:pat) +endf + +fu! s:matchtab(item, pat) + retu match(split(a:item, '\t\+[^\t]\+$')[0], a:pat) +endf + +fu! s:maxfiles(len) + retu s:maxfiles && a:len > s:maxfiles ? 1 : 0 +endf + +fu! s:insertcache(str) + let [data, g:ctrlp_newcache, str] = [g:ctrlp_allfiles, 1, a:str] + if strlen(str) <= strlen(data[0]) + let pos = 0 + elsei strlen(str) >= strlen(data[-1]) + let pos = len(data) - 1 + el + let pos = 0 + for each in data + if strlen(each) > strlen(str) | brea | en + let pos += 1 + endfo + en + cal insert(data, str, pos) + cal s:writecache(0, ctrlp#utils#cachefile()) +endf + +fu! s:lscommand() + let cmd = s:usrcmd + if type(cmd) == 1 + retu cmd + elsei type(cmd) == 3 && len(cmd) >= 2 && !empty(cmd[0]) && !empty(cmd[1]) + let rmarker = cmd[0] + " Find a repo root + cal s:findroot(getcwd(), rmarker, 0, 1) + if !exists('s:vcsroot') || ( exists('s:vcsroot') && empty(s:vcsroot) ) + " Try the secondary_command + retu len(cmd) == 3 ? cmd[2] : '' + en + let s:vcscmd = s:lash == '\' ? 1 : 0 + retu cmd[1] + en +endf +" Extensions {{{2 +fu! s:tagfiles() + retu filter(map(tagfiles(), 'fnamemodify(v:val, ":p")'), 'filereadable(v:val)') +endf + +fu! ctrlp#exit() + cal s:PrtExit() +endf + +fu! ctrlp#prtclear() + cal s:PrtClear() +endf + +fu! ctrlp#setlines(type) + cal s:SetLines(a:type) +endf +"}}}1 +" * Initialization {{{1 +fu! s:SetLines(type) + let s:itemtype = a:type + let types = [ + \ 's:Files()', + \ 's:Buffers()', + \ 'ctrlp#mrufiles#list(-1)', + \ ] + if exists('g:ctrlp_ext_vars') + cal map(copy(g:ctrlp_ext_vars), 'add(types, v:val[0])') + en + let g:ctrlp_lines = eval(types[a:type]) +endf + +fu! ctrlp#init(type, ...) + if exists('s:init') | retu | en + let [s:matches, s:init] = [1, 1] + cal s:Open() + cal s:SetWD(exists('a:1') ? a:1 : '') + cal s:MapKeys() + cal s:SetLines(a:type) + cal s:BuildPrompt(1) + if has('syntax') && exists('g:syntax_on') + cal s:syntax() + en +endf +if has('autocmd') "{{{1 + aug CtrlPAug + au! + au BufEnter ControlP cal s:checkbuf() + au BufLeave ControlP cal s:Close() + au VimLeavePre * cal s:leavepre() + if s:lazy + au CursorHold ControlP cal s:ForceUpdate() + en + aug END +en "}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff -r 000000000000 -r 48859d9c82c5 vim/vimfiles/autoload/ctrlp/dir.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/vimfiles/autoload/ctrlp/dir.vim Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,95 @@ +" ============================================================================= +" File: autoload/ctrlp/dir.vim +" Description: Directory extension +" Author: Kien Nguyen +" ============================================================================= + +" Init {{{1 +if exists('g:loaded_ctrlp_dir') && g:loaded_ctrlp_dir + fini +en +let [g:loaded_ctrlp_dir, g:ctrlp_newdir] = [1, 0] + +let s:ars = [ + \ 's:folsym', + \ 's:dotfiles', + \ 's:maxdepth', + \ 's:maxfiles', + \ 's:compare_lim', + \ 's:glob', + \ ] + +let s:dir_var = ['ctrlp#dir#init('.join(s:ars, ', ').')', 'ctrlp#dir#accept', + \ 'dirs', 'dir'] + +let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars) + \ ? add(g:ctrlp_ext_vars, s:dir_var) : [s:dir_var] + +let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) +" Utilities {{{1 +fu! s:globdirs(dirs, depth) + let entries = split(globpath(a:dirs, s:glob), "\n") + if !s:folsym + let entries = filter(entries, 'getftype(v:val) != "link"') + en + let ftrfunc = s:dotfiles ? 'ctrlp#dirfilter(v:val)' : 'isdirectory(v:val)' + let alldirs = filter(entries, ftrfunc) + cal extend(g:ctrlp_alldirs, alldirs) + let depth = a:depth + 1 + if !empty(g:ctrlp_alldirs) && !s:max(len(g:ctrlp_alldirs), s:maxfiles) + \ && depth <= s:maxdepth + sil! cal ctrlp#progress(len(g:ctrlp_alldirs)) + cal s:globdirs(join(alldirs, ','), depth) + en +endf + +fu! s:max(len, max) + retu a:max && a:len > a:max ? 1 : 0 +endf +" Public {{{1 +fu! ctrlp#dir#init(...) + let s:cwd = getcwd() + for each in range(len(s:ars)) + exe 'let' s:ars[each] '=' string(eval('a:'.(each + 1))) + endfo + let cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().s:dir_var[3] + let cafile = cadir.ctrlp#utils#lash().ctrlp#utils#cachefile(s:dir_var[3]) + if g:ctrlp_newdir || !filereadable(cafile) + let g:ctrlp_alldirs = [] + cal s:globdirs(s:cwd, 0) + cal ctrlp#rmbasedir(g:ctrlp_alldirs) + let read_cache = 0 + el + let g:ctrlp_alldirs = ctrlp#utils#readfile(cafile) + let read_cache = 1 + en + if len(g:ctrlp_alldirs) <= s:compare_lim + cal sort(g:ctrlp_alldirs, 'ctrlp#complen') + en + if !read_cache + cal ctrlp#utils#writecache(g:ctrlp_alldirs, cadir, cafile) + let g:ctrlp_newdir = 0 + en + retu g:ctrlp_alldirs +endf + +fu! ctrlp#dir#accept(mode, str) + let path = a:mode == 'h' ? getcwd() : s:cwd.ctrlp#utils#lash().a:str + if a:mode =~ 't\|v\|h' + cal ctrlp#exit() + en + cal ctrlp#setdir(path, a:mode =~ 't\|h' ? 'chd!' : 'lc!') + if a:mode == 'e' + sil! cal ctrlp#statusline() + cal ctrlp#setlines(s:id) + cal ctrlp#recordhist() + cal ctrlp#prtclear() + en +endf + +fu! ctrlp#dir#id() + retu s:id +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff -r 000000000000 -r 48859d9c82c5 vim/vimfiles/autoload/ctrlp/line.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/vimfiles/autoload/ctrlp/line.vim Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,61 @@ +" ============================================================================= +" File: autoload/ctrlp/line.vim +" Description: Line extension - find a line in any buffer. +" Author: Kien Nguyen +" ============================================================================= + +" Init {{{1 +if exists('g:loaded_ctrlp_line') && g:loaded_ctrlp_line + fini +en +let g:loaded_ctrlp_line = 1 + +let s:line_var = ['ctrlp#line#init()', 'ctrlp#line#accept', 'lines', 'line'] + +let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars) + \ ? add(g:ctrlp_ext_vars, s:line_var) : [s:line_var] + +let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) +" Public {{{1 +fu! ctrlp#line#init() + let [bufs, lines] = [[], []] + for each in range(1, bufnr('$')) + if getbufvar(each, '&bl') + let bufname = bufname(each) + if strlen(bufname) && bufname != 'ControlP' + cal add(bufs, fnamemodify(bufname, ':p')) + en + en + endfo + cal filter(bufs, 'filereadable(v:val)') + for each in bufs + let from_file = readfile(each) + cal map(from_file, 'tr(v:val, '' '', '' '')') + let [id, len_ff, bufnr] = [1, len(from_file), bufnr(each)] + wh id <= len_ff + let from_file[id-1] .= ' #:'.bufnr.':'.id + let id += 1 + endw + cal filter(from_file, 'v:val !~ ''^\s*\t#:\d\+:\d\+$''') + cal extend(lines, from_file) + endfo + sy match CtrlPTabExtra '\zs\t.*\ze$' + hi link CtrlPTabExtra Comment + retu lines +endf + +fu! ctrlp#line#accept(mode, str) + let info = get(split(a:str, '\t#:\ze\d\+:\d\+$'), 1, 0) + let bufnr = str2nr(get(split(info, ':'), 0, 0)) + let linenr = get(split(info, ':'), 1, 0) + if bufnr + cal ctrlp#acceptfile(a:mode, fnamemodify(bufname(bufnr), ':p'), linenr) + en +endf + +fu! ctrlp#line#id() + retu s:id +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff -r 000000000000 -r 48859d9c82c5 vim/vimfiles/autoload/ctrlp/mrufiles.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/vimfiles/autoload/ctrlp/mrufiles.vim Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,68 @@ +" ============================================================================= +" File: autoload/ctrlp/mrufiles.vim +" Description: Most Recently Used Files extension +" Author: Kien Nguyen +" ============================================================================= + +" Static variables {{{1 +fu! ctrlp#mrufiles#opts() + let opts = { + \ 'g:ctrlp_mruf_max': ['s:max', 250], + \ 'g:ctrlp_mruf_include': ['s:include', ''], + \ 'g:ctrlp_mruf_exclude': ['s:exclude', ''], + \ 'g:ctrlp_mruf_case_sensitive': ['s:csen', 1], + \ } + for [ke, va] in items(opts) + exe 'let' va[0] '=' string(exists(ke) ? eval(ke) : va[1]) + endfo +endf +cal ctrlp#mrufiles#opts() +fu! ctrlp#mrufiles#list(bufnr, ...) "{{{1 + if s:locked | retu | en + " Get the list + let cadir = ctrlp#utils#cachedir().ctrlp#utils#lash().'mru' + let cafile = cadir.ctrlp#utils#lash().'cache.txt' + let mrufs = ctrlp#utils#readfile(cafile) + " Remove non-existent files + if exists('a:1') && a:1 == 1 + let mrufs = s:rmdeleted(mrufs, cadir, cafile) + elsei exists('a:1') && a:1 == 2 + cal ctrlp#utils#writecache([], cadir, cafile) + retu [] + en + " Return the list + if a:bufnr == -1 | retu mrufs | en + " Filter it + let filename = fnamemodify(bufname(a:bufnr + 0), ':p') + if empty(filename) || !empty(&bt) + \ || ( !empty(s:include) && filename !~# s:include ) + \ || ( !empty(s:exclude) && filename =~# s:exclude ) + \ || ( index(mrufs, filename) == -1 && !filereadable(filename) ) + retu + en + " Remove old matched entry + cal filter(mrufs, 'v:val !='.( s:csen ? "#" : "?" ).' filename') + " Insert new one + cal insert(mrufs, filename) + " Remove oldest entry + if len(mrufs) > s:max | cal remove(mrufs, s:max, -1) | en + cal ctrlp#utils#writecache(mrufs, cadir, cafile) +endf "}}} +fu! s:rmdeleted(mrufs, cadir, cafile) "{{{ + cal filter(a:mrufs, '!empty(ctrlp#utils#glob(v:val, 1))') + cal ctrlp#utils#writecache(a:mrufs, a:cadir, a:cafile) + retu a:mrufs +endf +fu! ctrlp#mrufiles#init() "{{{1 + let s:locked = 0 + aug CtrlPMRUF + au! + au BufReadPost,BufNewFile,BufWritePost * + \ cal ctrlp#mrufiles#list(expand('', 1)) + au QuickFixCmdPre *vimgrep* let s:locked = 1 + au QuickFixCmdPost *vimgrep* let s:locked = 0 + aug END +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff -r 000000000000 -r 48859d9c82c5 vim/vimfiles/autoload/ctrlp/quickfix.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/vimfiles/autoload/ctrlp/quickfix.vim Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,55 @@ +" ============================================================================= +" File: autoload/ctrlp/quickfix.vim +" Description: Quickfix extension +" Author: Kien Nguyen +" ============================================================================= + +" Init {{{1 +if exists('g:loaded_ctrlp_quickfix') && g:loaded_ctrlp_quickfix + fini +en +let g:loaded_ctrlp_quickfix = 1 + +let s:var_qf = ['ctrlp#quickfix#init()', 'ctrlp#quickfix#accept', 'quickfix', + \ 'qfx', [1]] + +let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars) + \ ? add(g:ctrlp_ext_vars, s:var_qf) : [s:var_qf] + +let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) + +fu! s:lineout(dict) + retu printf('%s|%d:%d| %s', bufname(a:dict['bufnr']), a:dict['lnum'], + \ a:dict['col'], matchstr(a:dict['text'], '\s*\zs.*\S')) +endf +" Public {{{1 +fu! ctrlp#quickfix#init() + let g:ctrlp_nolimit = 1 + sy match CtrlPqfLineCol '|\zs\d\+:\d\+\ze|' + hi def link CtrlPqfLineCol Search + retu map(getqflist(), 's:lineout(v:val)') +endf + +fu! ctrlp#quickfix#accept(mode, str) + let items = matchlist(a:str, '^\([^|]\+\ze\)|\(\d\+\):\(\d\+\)|') + let [md, filpath] = [a:mode, fnamemodify(items[1], ':p')] + if empty(filpath) | retu | en + cal ctrlp#exit() + let cmd = md == 't' ? 'tabe' : md == 'h' ? 'new' : md == 'v' ? 'vne' + \ : ctrlp#normcmd('e') + let cmd = cmd == 'e' && &modified ? 'hid e' : cmd + try + exe cmd.' '.ctrlp#fnesc(filpath) + cat + cal ctrlp#msg("Invalid command or argument.") + fina + cal cursor(items[2], items[3]) | sil! norm! zOzz + endt +endf + +fu! ctrlp#quickfix#id() + retu s:id +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff -r 000000000000 -r 48859d9c82c5 vim/vimfiles/autoload/ctrlp/tag.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/vimfiles/autoload/ctrlp/tag.vim Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,109 @@ +" ============================================================================= +" File: autoload/ctrlp/tag.vim +" Description: Tag file extension +" Author: Kien Nguyen +" ============================================================================= + +" Init {{{1 +if exists('g:loaded_ctrlp_tag') && g:loaded_ctrlp_tag + fini +en +let g:loaded_ctrlp_tag = 1 + +let s:tag_var = ['ctrlp#tag#init(s:tagfiles)', 'ctrlp#tag#accept', + \ 'tags', 'tag'] + +let g:ctrlp_ext_vars = exists('g:ctrlp_ext_vars') && !empty(g:ctrlp_ext_vars) + \ ? add(g:ctrlp_ext_vars, s:tag_var) : [s:tag_var] + +let s:id = g:ctrlp_builtins + len(g:ctrlp_ext_vars) +" Utilities {{{1 +fu! s:nodup(items) + let dict = {} + for each in a:items + cal extend(dict, { each : 0 }) + endfo + retu keys(dict) +endf + +fu! s:findcount(str) + let [tg, fname] = split(a:str, '\t\+\ze[^\t]\+$') + let [&l:tags, fname] = [s:ltags, expand(fname, 1)] + let tgs = taglist('^'.tg.'$') + if empty(tgs) | retu [1, 1] | en + let [fnd, ct, pos] = [0, 0, 0] + for each in tgs + let ct += 1 + let fulname = fnamemodify(each["filename"], ':p') + if stridx(fulname, fname) >= 0 + \ && strlen(fname) + stridx(fulname, fname) == strlen(fulname) + let fnd += 1 + let pos = ct + en + if fnd > 1 | brea | en + endfo + retu [fnd, pos] +endf + +fu! s:filter(tags) + let [nr, alltags] = [0, a:tags] + wh 0 < 1 + if alltags[nr] =~ '^!' && alltags[nr] !~ '^!_TAG_' + let nr += 1 + con + en + if alltags[nr] =~ '^!_TAG_' && len(alltags) > nr + cal remove(alltags, nr) + el + brea + en + endw + retu alltags +endf +" Public {{{1 +fu! ctrlp#tag#init(tagfiles) + if empty(a:tagfiles) | retu [] | en + let tagfiles = sort(s:nodup(a:tagfiles)) + let s:ltags = join(tagfiles, ',') + let g:ctrlp_alltags = [] + for each in tagfiles + let alltags = s:filter(ctrlp#utils#readfile(each)) + cal extend(g:ctrlp_alltags, alltags) + endfo + sy match CtrlPTabExtra '\zs\t.*\ze$' + hi link CtrlPTabExtra Comment + retu g:ctrlp_alltags +endf + +fu! ctrlp#tag#accept(mode, str) + cal ctrlp#exit() + let str = matchstr(a:str, '^[^\t]\+\t\+[^\t]\+\ze\t') + let [md, tg] = [a:mode, split(str, '^[^\t]\+\zs\t')[0]] + let fnd = s:findcount(str) + let cmds = { + \ 't': ['tabe', 'tab stj'], + \ 'h': ['new', 'stj'], + \ 'v': ['vne', 'vert stj'], + \ 'e': ['ene', 'tj'], + \ } + let cmd = fnd[0] == 1 ? cmds[md][0] : cmds[md][1] + let cmd = cmd =~ 'tj\|ene' && &modified ? 'hid '.cmd : cmd + try + if fnd[0] == 1 + exe cmd + let &l:tags = s:ltags + exe fnd[1].'ta' tg + el + exe cmd.' '.tg + en + cat + cal ctrlp#msg("Tag not found.") + endt +endf + +fu! ctrlp#tag#id() + retu s:id +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff -r 000000000000 -r 48859d9c82c5 vim/vimfiles/autoload/ctrlp/utils.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/vimfiles/autoload/ctrlp/utils.vim Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,68 @@ +" ============================================================================= +" File: autoload/ctrlp/utils.vim +" Description: Utilities +" Author: Kien Nguyen +" ============================================================================= + +" Static variables {{{1 +fu! ctrlp#utils#lash() + retu &ssl || !exists('+ssl') ? '/' : '\' +endf +let s:lash = ctrlp#utils#lash() + +fu! ctrlp#utils#opts() + let s:cache_dir = $HOME.s:lash.'.ctrlp_cache' + if exists('g:ctrlp_cache_dir') + let s:cache_dir = expand(g:ctrlp_cache_dir, 1) + if isdirectory(s:cache_dir.s:lash.'.ctrlp_cache') + let s:cache_dir = s:cache_dir.s:lash.'.ctrlp_cache' + en + en +endf +cal ctrlp#utils#opts() +" Files and Directories {{{1 +fu! ctrlp#utils#cachedir() + retu s:cache_dir +endf + +fu! ctrlp#utils#cachefile(...) + let tail = exists('a:1') ? '.'.a:1 : '' + let cache_file = substitute(getcwd(), '\([\/]\|^\a\zs:\)', '%', 'g').tail.'.txt' + retu exists('a:1') ? cache_file : s:cache_dir.s:lash.cache_file +endf + +fu! ctrlp#utils#readfile(file) + if filereadable(a:file) + let data = readfile(a:file) + if empty(data) || type(data) != 3 + unl data + let data = [] + en + retu data + en + retu [] +endf + +fu! ctrlp#utils#mkdir(dir) + if exists('*mkdir') && !isdirectory(a:dir) + sil! cal mkdir(a:dir) + en +endf + +fu! ctrlp#utils#writecache(lines, ...) + let cache_dir = exists('a:1') ? a:1 : s:cache_dir + cal ctrlp#utils#mkdir(cache_dir) + if isdirectory(cache_dir) + sil! cal writefile(a:lines, exists('a:2') ? a:2 : ctrlp#utils#cachefile()) + if !exists('a:1') + let g:ctrlp_newcache = 0 + en + en +endf + +fu! ctrlp#utils#glob(...) + retu call('glob', v:version > 701 ? a:000 : a:1) +endf +"}}} + +" vim:fen:fdm=marker:fmr={{{,}}}:fdl=0:fdc=1:ts=2:sw=2:sts=2 diff -r 000000000000 -r 48859d9c82c5 vim/vimfiles/colors/Dark.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/vimfiles/colors/Dark.vim Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,63 @@ + +" +" Restore default colors +hi clear +set background=dark + + +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = "Dark" + + +hi Normal guibg=grey20 guifg=GhostWhite +hi NonText guibg=grey15 guifg=yellow3 +"hi Cursor guibg=GhostWhite +"hi Cursor guibg=red guifg=white +hi Cursor guibg=green2 guifg=black + +hi Statement guifg=tan +hi Constant guifg=#FF7070 +hi String guifg=#ffa0a0 +hi Comment guifg=SkyBlue +hi PreProc guifg=orchid2 +hi Character guifg=Cyan +hi Type guifg=orange gui=none +hi Special guifg=#DDDD00 +hi Identifier guifg=#60DD60 +hi link Function Identifier +"hi Function guifg=#ffa0a0 + +" Slight tweaks after some time away: +hi Type guifg=LightMagenta +hi PreProc guifg=orange2 + + +hi link SpecialKey Comment +hi link Directory Comment + +" +" Colors not part of the original set: +" +"hi Folded guifg=cyan4 guibg=grey20 +hi Folded guifg=grey90 guibg=grey45 +hi Visual gui=reverse guibg=fg guifg=darkolivegreen +hi Search guifg=black guibg=LightSkyBlue3 gui=none +"hi IncSearch guifg=yellow guibg=LightSkyBlue3 gui=bold +hi IncSearch guibg=blue guifg=yellow gui=bold +hi WarningMsg guifg=red guibg=GhostWhite gui=bold +hi Error guibg=red3 + + +" Here are the original colors: +"hi guifg=grey70 gui=bold +"hi guifg=#FF7070 gui=bold +"hi guifg=green gui=bold +"hi guifg=yellow gui=bold +"hi guifg=SkyBlue gui=bold +"hi guifg=orchid1 gui=bold +"hi guifg=Cyan gui=bold +"hi guifg=White gui=bold +" diff -r 000000000000 -r 48859d9c82c5 vim/vimfiles/colors/peaksea.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/vimfiles/colors/peaksea.vim Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,601 @@ +" Vim color file --- psc (peak sea color) "Lite version" +" Maintainer: Pan, Shi Zhu +" URL: http://vim.sourceforge.net/scripts/script.php?script_id=760 +" Last Change: 5 Feb 2010 +" Version: 3.4 +" +" Comments and e-mails are welcomed, thanks. +" +" The peaksea color is simply a colorscheme with the default settings of +" the original ps_color. Lite version means there's no custom settings +" and fancy features such as integration with reloaded.vim +" +" The full version of ps_color.vim will be maintained until Vim 8. +" By then there will be only the lite version: peaksea.vim +" +" Note: Please set the background option in your .vimrc and/or .gvimrc +" +" It is much better *not* to set 'background' option inside +" a colorscheme file. because ":set background" improperly +" may cause colorscheme be sourced twice +" +" Color Scheme Overview: +" :ru syntax/hitest.vim +" +" Relevant Help: +" :h highlight-groups +" :h psc-cterm-color-table +" +" Colors Order: +" #rrggbb +" + +hi clear + +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = expand(":t:r") + +" I don't want to abuse folding, but here folding is used to avoid confusion. +if &background=='light' + " for background=light {{{2 + " LIGHT COLOR DEFINE START + + hi Normal guifg=#000000 guibg=#e0e0e0 gui=NONE + hi Search guifg=NONE guibg=#f8f8f8 gui=NONE + hi Visual guifg=NONE guibg=#a6caf0 gui=NONE + hi Cursor guifg=#f0f0f0 guibg=#008000 gui=NONE + " The idea of CursorIM is pretty good, however, the feature is still buggy + " in the current version (Vim 7.0). + " The following line will be kept commented until the bug fixed. + " + " hi CursorIM guifg=#f0f0f0 guibg=#800080 + hi Special guifg=#907000 guibg=NONE gui=NONE + hi Comment guifg=#606000 guibg=NONE gui=NONE + hi Number guifg=#907000 guibg=NONE gui=NONE + hi Constant guifg=#007068 guibg=NONE gui=NONE + hi StatusLine guifg=fg guibg=#a6caf0 gui=NONE + hi LineNr guifg=#686868 guibg=NONE gui=NONE + hi Question guifg=fg guibg=#d0d090 gui=NONE + hi PreProc guifg=#009030 guibg=NONE gui=NONE + hi Statement guifg=#2060a8 guibg=NONE gui=NONE + hi Type guifg=#0850a0 guibg=NONE gui=NONE + hi Todo guifg=#800000 guibg=#e0e090 gui=NONE + " NOTE THIS IS IN THE WARM SECTION + hi Error guifg=#c03000 guibg=NONE gui=NONE + hi Identifier guifg=#a030a0 guibg=NONE gui=NONE + hi ModeMsg guifg=fg guibg=#b0b0e0 gui=NONE + hi VisualNOS guifg=fg guibg=#b0b0e0 gui=NONE + hi SpecialKey guifg=#1050a0 guibg=NONE gui=NONE + hi NonText guifg=#002090 guibg=#d0d0d0 gui=NONE + hi Directory guifg=#a030a0 guibg=NONE gui=NONE + hi ErrorMsg guifg=fg guibg=#f0b090 gui=NONE + hi MoreMsg guifg=#489000 guibg=NONE gui=NONE + hi Title guifg=#a030a0 guibg=NONE gui=NONE + hi WarningMsg guifg=#b02000 guibg=NONE gui=NONE + hi WildMenu guifg=fg guibg=#d0d090 gui=NONE + hi Folded guifg=NONE guibg=#b0e0b0 gui=NONE + hi FoldColumn guifg=fg guibg=#90e090 gui=NONE + hi DiffAdd guifg=NONE guibg=#b0b0e0 gui=NONE + hi DiffChange guifg=NONE guibg=#e0b0e0 gui=NONE + hi DiffDelete guifg=#002090 guibg=#d0d0d0 gui=NONE + hi DiffText guifg=NONE guibg=#c0e080 gui=NONE + hi SignColumn guifg=fg guibg=#90e090 gui=NONE + + hi IncSearch guifg=#f0f0f0 guibg=#806060 gui=NONE + hi StatusLineNC guifg=fg guibg=#c0c0c0 gui=NONE + hi VertSplit guifg=fg guibg=#c0c0c0 gui=NONE + hi Underlined guifg=#6a5acd guibg=NONE gui=underline + hi Ignore guifg=bg guibg=NONE + " NOTE THIS IS IN THE WARM SECTION + if v:version >= 700 + if has('spell') + hi SpellBad guifg=NONE guibg=NONE guisp=#c03000 + hi SpellCap guifg=NONE guibg=NONE guisp=#2060a8 + hi SpellRare guifg=NONE guibg=NONE guisp=#a030a0 + hi SpellLocal guifg=NONE guibg=NONE guisp=#007068 + endif + hi Pmenu guifg=fg guibg=#e0b0e0 + hi PmenuSel guifg=#f0f0f0 guibg=#806060 gui=NONE + hi PmenuSbar guifg=fg guibg=#c0c0c0 gui=NONE + hi PmenuThumb guifg=fg guibg=#c0e080 gui=NONE + hi TabLine guifg=fg guibg=#c0c0c0 gui=NONE + hi TabLineFill guifg=fg guibg=#c0c0c0 gui=NONE + hi TabLineSel guifg=fg guibg=NONE gui=NONE + hi CursorColumn guifg=NONE guibg=#f0b090 + hi CursorLine guifg=NONE guibg=NONE gui=underline + hi MatchParen guifg=NONE guibg=#c0e080 + endif + + " LIGHT COLOR DEFINE END + + " Vim 7 added stuffs + if v:version >= 700 + hi Ignore gui=NONE + + " the gui=undercurl guisp could only support in Vim 7 + if has('spell') + hi SpellBad gui=undercurl + hi SpellCap gui=undercurl + hi SpellRare gui=undercurl + hi SpellLocal gui=undercurl + endif + hi TabLine gui=underline + hi TabLineFill gui=underline + hi CursorLine gui=underline + endif + + " For reversed stuffs, clear the reversed prop and set the bold prop again + hi IncSearch gui=bold + hi StatusLine gui=bold + hi StatusLineNC gui=bold + hi VertSplit gui=bold + hi Visual gui=bold + + " Enable the bold property + hi Question gui=bold + hi DiffText gui=bold + hi Statement gui=bold + hi Type gui=bold + hi MoreMsg gui=bold + hi ModeMsg gui=bold + hi NonText gui=bold + hi Title gui=bold + hi DiffDelete gui=bold + hi TabLineSel gui=bold + + " gui define for background=light end here + + " generally, a dumb terminal is dark, we assume the light terminal has 256 + " color support. + if &t_Co==8 || &t_Co==16 + set t_Co=256 + endif + if &t_Co==256 + " 256color light terminal support here + + hi Normal ctermfg=16 ctermbg=254 cterm=NONE + " Comment/Uncomment the following line to disable/enable transparency + "hi Normal ctermfg=16 ctermbg=NONE cterm=NONE + hi Search ctermfg=NONE ctermbg=231 cterm=NONE + hi Visual ctermfg=NONE ctermbg=153 cterm=NONE + hi Cursor ctermfg=255 ctermbg=28 cterm=NONE + " hi CursorIM ctermfg=255 ctermbg=90 + hi Special ctermfg=94 ctermbg=NONE cterm=NONE + hi Comment ctermfg=58 ctermbg=NONE cterm=NONE + hi Number ctermfg=94 ctermbg=NONE cterm=NONE + hi Constant ctermfg=23 ctermbg=NONE cterm=NONE + hi StatusLine ctermfg=fg ctermbg=153 cterm=NONE + hi LineNr ctermfg=242 ctermbg=NONE cterm=NONE + hi Question ctermfg=fg ctermbg=186 cterm=NONE + hi PreProc ctermfg=29 ctermbg=NONE cterm=NONE + hi Statement ctermfg=25 ctermbg=NONE cterm=NONE + hi Type ctermfg=25 ctermbg=NONE cterm=NONE + hi Todo ctermfg=88 ctermbg=186 cterm=NONE + " NOTE THIS IS IN THE WARM SECTION + hi Error ctermfg=130 ctermbg=NONE cterm=NONE + hi Identifier ctermfg=133 ctermbg=NONE cterm=NONE + hi ModeMsg ctermfg=fg ctermbg=146 cterm=NONE + hi VisualNOS ctermfg=fg ctermbg=146 cterm=NONE + hi SpecialKey ctermfg=25 ctermbg=NONE cterm=NONE + hi NonText ctermfg=18 ctermbg=252 cterm=NONE + " Comment/Uncomment the following line to disable/enable transparency + "hi NonText ctermfg=18 ctermbg=NONE cterm=NONE + hi Directory ctermfg=133 ctermbg=NONE cterm=NONE + hi ErrorMsg ctermfg=fg ctermbg=216 cterm=NONE + hi MoreMsg ctermfg=64 ctermbg=NONE cterm=NONE + hi Title ctermfg=133 ctermbg=NONE cterm=NONE + hi WarningMsg ctermfg=124 ctermbg=NONE cterm=NONE + hi WildMenu ctermfg=fg ctermbg=186 cterm=NONE + hi Folded ctermfg=NONE ctermbg=151 cterm=NONE + hi FoldColumn ctermfg=fg ctermbg=114 cterm=NONE + hi DiffAdd ctermfg=NONE ctermbg=146 cterm=NONE + hi DiffChange ctermfg=NONE ctermbg=182 cterm=NONE + hi DiffDelete ctermfg=18 ctermbg=252 cterm=NONE + hi DiffText ctermfg=NONE ctermbg=150 cterm=NONE + hi SignColumn ctermfg=fg ctermbg=114 cterm=NONE + + hi IncSearch ctermfg=255 ctermbg=95 cterm=NONE + hi StatusLineNC ctermfg=fg ctermbg=250 cterm=NONE + hi VertSplit ctermfg=fg ctermbg=250 cterm=NONE + hi Underlined ctermfg=62 ctermbg=NONE cterm=underline + hi Ignore ctermfg=bg ctermbg=NONE + " NOTE THIS IS IN THE WARM SECTION + if v:version >= 700 + if has('spell') + if 0 + " ctermsp is not supported in Vim7, we ignore it. + hi SpellBad cterm=undercurl ctermbg=NONE ctermfg=130 + hi SpellCap cterm=undercurl ctermbg=NONE ctermfg=25 + hi SpellRare cterm=undercurl ctermbg=NONE ctermfg=133 + hi SpellLocal cterm=undercurl ctermbg=NONE ctermfg=23 + else + hi SpellBad cterm=undercurl ctermbg=NONE ctermfg=NONE + hi SpellCap cterm=undercurl ctermbg=NONE ctermfg=NONE + hi SpellRare cterm=undercurl ctermbg=NONE ctermfg=NONE + hi SpellLocal cterm=undercurl ctermbg=NONE ctermfg=NONE + endif + endif + hi Pmenu ctermfg=fg ctermbg=182 + hi PmenuSel ctermfg=255 ctermbg=95 cterm=NONE + hi PmenuSbar ctermfg=fg ctermbg=250 cterm=NONE + hi PmenuThumb ctermfg=fg ctermbg=150 cterm=NONE + hi TabLine ctermfg=fg ctermbg=250 cterm=NONE + hi TabLineFill ctermfg=fg ctermbg=250 cterm=NONE + hi TabLineSel ctermfg=fg ctermbg=NONE cterm=NONE + hi CursorColumn ctermfg=NONE ctermbg=216 + hi CursorLine ctermfg=NONE ctermbg=NONE cterm=underline + hi MatchParen ctermfg=NONE ctermbg=150 + endif + + hi TabLine cterm=underline + hi TabLineFill cterm=underline + hi CursorLine cterm=underline + + " For reversed stuffs, clear the reversed prop and set the bold prop again + hi IncSearch cterm=bold + hi StatusLine cterm=bold + hi StatusLineNC cterm=bold + hi VertSplit cterm=bold + hi Visual cterm=bold + + hi NonText cterm=bold + hi Question cterm=bold + hi Title cterm=bold + hi DiffDelete cterm=bold + hi DiffText cterm=bold + hi Statement cterm=bold + hi Type cterm=bold + hi MoreMsg cterm=bold + hi ModeMsg cterm=bold + hi TabLineSel cterm=bold + + "hi lCursor ctermfg=bg ctermbg=fg cterm=NONE + endif " t_Co==256 + " }}}2 +elseif &background=='dark' + " for background=dark {{{2 + " DARK COLOR DEFINE START + + hi Normal guifg=#d0d0d0 guibg=#202020 gui=NONE + hi Comment guifg=#d0d090 guibg=NONE gui=NONE + hi Constant guifg=#80c0e0 guibg=NONE gui=NONE + hi Number guifg=#e0c060 guibg=NONE gui=NONE + hi Identifier guifg=#f0c0f0 guibg=NONE gui=NONE + hi Statement guifg=#c0d8f8 guibg=NONE gui=NONE + hi PreProc guifg=#60f080 guibg=NONE gui=NONE + hi Type guifg=#b0d0f0 guibg=NONE gui=NONE + hi Special guifg=#e0c060 guibg=NONE gui=NONE + hi Error guifg=#f08060 guibg=NONE gui=NONE + hi Todo guifg=#800000 guibg=#d0d090 gui=NONE + hi Search guifg=NONE guibg=#800000 gui=NONE + hi Visual guifg=#000000 guibg=#a6caf0 gui=NONE + hi Cursor guifg=#000000 guibg=#00f000 gui=NONE + " NOTE THIS IS IN THE COOL SECTION + " hi CursorIM guifg=#000000 guibg=#f000f0 gui=NONE + hi StatusLine guifg=#000000 guibg=#a6caf0 gui=NONE + hi LineNr guifg=#b0b0b0 guibg=NONE gui=NONE + hi Question guifg=#000000 guibg=#d0d090 gui=NONE + hi ModeMsg guifg=fg guibg=#000080 gui=NONE + hi VisualNOS guifg=fg guibg=#000080 gui=NONE + hi SpecialKey guifg=#b0d0f0 guibg=NONE gui=NONE + hi NonText guifg=#6080f0 guibg=#101010 gui=NONE + hi Directory guifg=#80c0e0 guibg=NONE gui=NONE + hi ErrorMsg guifg=#d0d090 guibg=#800000 gui=NONE + hi MoreMsg guifg=#c0e080 guibg=NONE gui=NONE + hi Title guifg=#f0c0f0 guibg=NONE gui=NONE + hi WarningMsg guifg=#f08060 guibg=NONE gui=NONE + hi WildMenu guifg=#000000 guibg=#d0d090 gui=NONE + hi Folded guifg=NONE guibg=#004000 gui=NONE + hi FoldColumn guifg=#e0e0e0 guibg=#008000 gui=NONE + hi DiffAdd guifg=NONE guibg=#000080 gui=NONE + hi DiffChange guifg=NONE guibg=#800080 gui=NONE + hi DiffDelete guifg=#6080f0 guibg=#202020 gui=NONE + hi DiffText guifg=#000000 guibg=#c0e080 gui=NONE + hi SignColumn guifg=#e0e0e0 guibg=#008000 gui=NONE + hi IncSearch guifg=#000000 guibg=#d0d0d0 gui=NONE + hi StatusLineNC guifg=#000000 guibg=#c0c0c0 gui=NONE + hi VertSplit guifg=#000000 guibg=#c0c0c0 gui=NONE + hi Underlined guifg=#80a0ff guibg=NONE gui=underline + hi Ignore guifg=#000000 guibg=NONE + " NOTE THIS IS IN THE COOL SECTION + if v:version >= 700 + if has('spell') + " the guisp= could only support in Vim 7 + hi SpellBad guifg=NONE guibg=NONE guisp=#f08060 + hi SpellCap guifg=NONE guibg=NONE guisp=#6080f0 + hi SpellRare guifg=NONE guibg=NONE guisp=#f0c0f0 + hi SpellLocal guifg=NONE guibg=NONE guisp=#c0d8f8 + endif + hi Pmenu guifg=fg guibg=#800080 + hi PmenuSel guifg=#000000 guibg=#d0d0d0 gui=NONE + hi PmenuSbar guifg=fg guibg=#000080 gui=NONE + hi PmenuThumb guifg=fg guibg=#008000 gui=NONE + hi TabLine guifg=fg guibg=#008000 gui=NONE + hi TabLineFill guifg=fg guibg=#008000 gui=NONE + hi TabLineSel guifg=fg guibg=NONE gui=NONE + hi CursorColumn guifg=NONE guibg=#800000 gui=NONE + hi CursorLine guifg=NONE guibg=NONE gui=underline + hi MatchParen guifg=NONE guibg=#800080 + endif + + " DARK COLOR DEFINE END + + " Vim 7 added stuffs + if v:version >= 700 + hi Ignore gui=NONE + + " the gui=undercurl could only support in Vim 7 + if has('spell') + hi SpellBad gui=undercurl + hi SpellCap gui=undercurl + hi SpellRare gui=undercurl + hi SpellLocal gui=undercurl + endif + hi TabLine gui=underline + hi TabLineFill gui=underline + hi Underlined gui=underline + hi CursorLine gui=underline + endif + + " gui define for background=dark end here + + if &t_Co==8 || &t_Co==16 + " for 8-color and 16-color term + hi Normal ctermfg=LightGrey ctermbg=Black + hi Special ctermfg=Yellow ctermbg=bg + hi Comment ctermfg=DarkYellow ctermbg=bg + hi Constant ctermfg=Blue ctermbg=bg + hi Number ctermfg=Yellow ctermbg=bg + hi LineNr ctermfg=DarkGrey ctermbg=bg + hi PreProc ctermfg=Green ctermbg=bg + hi Statement ctermfg=Cyan ctermbg=bg + hi Type ctermfg=Cyan ctermbg=bg + hi Error ctermfg=Red ctermbg=bg + hi Identifier ctermfg=Magenta ctermbg=bg + hi SpecialKey ctermfg=Cyan ctermbg=bg + hi NonText ctermfg=Blue ctermbg=bg + hi Directory ctermfg=Blue ctermbg=bg + hi MoreMsg ctermfg=Green ctermbg=bg + hi Title ctermfg=Magenta ctermbg=bg + hi WarningMsg ctermfg=Red ctermbg=bg + hi DiffDelete ctermfg=Blue ctermbg=bg + + hi Search ctermfg=NONE ctermbg=DarkRed + hi Visual ctermfg=Black ctermbg=DarkCyan + hi Cursor ctermfg=Black ctermbg=Green + hi StatusLine ctermfg=Black ctermbg=DarkCyan + hi Question ctermfg=Black ctermbg=DarkYellow + hi Todo ctermfg=DarkRed ctermbg=DarkYellow + hi Folded ctermfg=White ctermbg=DarkGreen + hi ModeMsg ctermfg=Grey ctermbg=DarkBlue + hi VisualNOS ctermfg=Grey ctermbg=DarkBlue + hi ErrorMsg ctermfg=DarkYellow ctermbg=DarkRed + hi WildMenu ctermfg=Black ctermbg=DarkYellow + hi FoldColumn ctermfg=White ctermbg=DarkGreen + hi SignColumn ctermfg=White ctermbg=DarkGreen + hi DiffText ctermfg=Black ctermbg=DarkYellow + + if v:version >= 700 + if has('spell') + hi SpellBad ctermfg=NONE ctermbg=DarkRed + hi SpellCap ctermfg=NONE ctermbg=DarkBlue + hi SpellRare ctermfg=NONE ctermbg=DarkMagenta + hi SpellLocal ctermfg=NONE ctermbg=DarkGreen + endif + hi Pmenu ctermfg=fg ctermbg=DarkMagenta + hi PmenuSel ctermfg=Black ctermbg=fg + hi PmenuSbar ctermfg=fg ctermbg=DarkBlue + hi PmenuThumb ctermfg=fg ctermbg=DarkGreen + hi TabLine ctermfg=fg ctermbg=DarkGreen cterm=underline + hi TabLineFill ctermfg=fg ctermbg=DarkGreen cterm=underline + hi CursorColumn ctermfg=NONE ctermbg=DarkRed + + hi TabLineSel ctermfg=fg ctermbg=bg + hi CursorLine ctermfg=NONE ctermbg=bg cterm=underline + + hi MatchParen ctermfg=NONE ctermbg=DarkMagenta + endif + if &t_Co==8 + " 8 colour terminal support, this assumes 16 colour is available through + " setting the 'bold' attribute, will get bright foreground colour. + " However, the bright background color is not available for 8-color terms. + " + " You can manually set t_Co=16 in your .vimrc to see if your terminal + " supports 16 colours, + hi DiffText cterm=none + hi Visual cterm=none + hi Cursor cterm=none + hi Comment cterm=none + hi Todo cterm=none + hi StatusLine cterm=none + hi Question cterm=none + hi DiffChange cterm=none + hi ModeMsg cterm=none + hi VisualNOS cterm=none + hi ErrorMsg cterm=none + hi WildMenu cterm=none + hi DiffAdd cterm=none + hi Folded cterm=none + hi DiffDelete cterm=none + hi Normal cterm=none + hi PmenuThumb cterm=none + hi Search cterm=bold + hi Special cterm=bold + hi Constant cterm=bold + hi Number cterm=bold + hi LineNr cterm=bold + hi PreProc cterm=bold + hi Statement cterm=bold + hi Type cterm=bold + hi Error cterm=bold + hi Identifier cterm=bold + hi SpecialKey cterm=bold + hi NonText cterm=bold + hi MoreMsg cterm=bold + hi Title cterm=bold + hi WarningMsg cterm=bold + hi FoldColumn cterm=bold + hi SignColumn cterm=bold + hi Directory cterm=bold + hi DiffDelete cterm=bold + else + " Background > 7 is only available with 16 or more colors + + hi WarningMsg cterm=none + hi Search cterm=none + hi Visual cterm=none + hi Cursor cterm=none + hi Special cterm=none + hi Comment cterm=none + hi Constant cterm=none + hi Number cterm=none + hi LineNr cterm=none + hi PreProc cterm=none + hi Todo cterm=none + hi Error cterm=none + hi Identifier cterm=none + hi Folded cterm=none + hi SpecialKey cterm=none + hi Directory cterm=none + hi ErrorMsg cterm=none + hi Normal cterm=none + hi PmenuThumb cterm=none + hi WildMenu cterm=none + hi FoldColumn cterm=none + hi SignColumn cterm=none + hi DiffAdd cterm=none + hi DiffChange cterm=none + hi Question cterm=none + hi StatusLine cterm=none + hi DiffText cterm=none + hi IncSearch cterm=reverse + hi StatusLineNC cterm=reverse + hi VertSplit cterm=reverse + + " Well, well, bold font with color 0-7 is not possible. + " So, the Question, StatusLine, DiffText cannot act as expected. + + hi Statement cterm=none + hi Type cterm=none + hi MoreMsg cterm=none + hi ModeMsg cterm=none + hi NonText cterm=none + hi Title cterm=none + hi VisualNOS cterm=none + hi DiffDelete cterm=none + hi TabLineSel cterm=none + + endif + elseif &t_Co==256 + " 256color dark terminal support here + hi Normal ctermfg=252 ctermbg=234 cterm=NONE + " Comment/Uncomment the following line to disable/enable transparency + "hi Normal ctermfg=252 ctermbg=NONE cterm=NONE + hi Comment ctermfg=186 ctermbg=NONE cterm=NONE + hi Constant ctermfg=110 ctermbg=NONE cterm=NONE + hi Number ctermfg=179 ctermbg=NONE cterm=NONE + hi Identifier ctermfg=219 ctermbg=NONE cterm=NONE + hi Statement ctermfg=153 ctermbg=NONE cterm=NONE + hi PreProc ctermfg=84 ctermbg=NONE cterm=NONE + hi Type ctermfg=153 ctermbg=NONE cterm=NONE + hi Special ctermfg=179 ctermbg=NONE cterm=NONE + hi Error ctermfg=209 ctermbg=NONE cterm=NONE + hi Todo ctermfg=88 ctermbg=186 cterm=NONE + hi Search ctermfg=NONE ctermbg=88 cterm=NONE + hi Visual ctermfg=16 ctermbg=153 cterm=NONE + hi Cursor ctermfg=16 ctermbg=46 cterm=NONE + " NOTE THIS IS IN THE COOL SECTION + " hi CursorIM ctermfg=16 ctermbg=201 cterm=NONE + hi StatusLine ctermfg=16 ctermbg=153 cterm=NONE + hi LineNr ctermfg=249 ctermbg=NONE cterm=NONE + hi Question ctermfg=16 ctermbg=186 cterm=NONE + hi ModeMsg ctermfg=fg ctermbg=18 cterm=NONE + hi VisualNOS ctermfg=fg ctermbg=18 cterm=NONE + hi SpecialKey ctermfg=153 ctermbg=NONE cterm=NONE + hi NonText ctermfg=69 ctermbg=233 cterm=NONE + " Comment/Uncomment the following line to disable/enable transparency + "hi NonText ctermfg=69 ctermbg=NONE cterm=NONE + hi Directory ctermfg=110 ctermbg=NONE cterm=NONE + hi ErrorMsg ctermfg=186 ctermbg=88 cterm=NONE + hi MoreMsg ctermfg=150 ctermbg=NONE cterm=NONE + hi Title ctermfg=219 ctermbg=NONE cterm=NONE + hi WarningMsg ctermfg=209 ctermbg=NONE cterm=NONE + hi WildMenu ctermfg=16 ctermbg=186 cterm=NONE + hi Folded ctermfg=NONE ctermbg=22 cterm=NONE + hi FoldColumn ctermfg=254 ctermbg=28 cterm=NONE + hi DiffAdd ctermfg=NONE ctermbg=18 cterm=NONE + hi DiffChange ctermfg=NONE ctermbg=90 cterm=NONE + hi DiffDelete ctermfg=69 ctermbg=234 cterm=NONE + hi DiffText ctermfg=16 ctermbg=150 cterm=NONE + hi SignColumn ctermfg=254 ctermbg=28 cterm=NONE + hi IncSearch ctermfg=16 ctermbg=252 cterm=NONE + hi StatusLineNC ctermfg=16 ctermbg=250 cterm=NONE + hi VertSplit ctermfg=16 ctermbg=250 cterm=NONE + hi Underlined ctermfg=111 ctermbg=NONE cterm=underline + hi Ignore ctermfg=16 ctermbg=NONE + " NOTE THIS IS IN THE COOL SECTION + if v:version >= 700 + if has('spell') + " the ctermsp= is not supported in Vim 7 we simply ignored + if 0 + hi SpellBad cterm=undercurl ctermbg=NONE ctermfg=209 + hi SpellCap cterm=undercurl ctermbg=NONE ctermfg=69 + hi SpellRare cterm=undercurl ctermbg=NONE ctermfg=219 + hi SpellLocal cterm=undercurl ctermbg=NONE ctermfg=153 + else + hi SpellBad cterm=undercurl ctermbg=NONE ctermfg=NONE + hi SpellCap cterm=undercurl ctermbg=NONE ctermfg=NONE + hi SpellRare cterm=undercurl ctermbg=NONE ctermfg=NONE + hi SpellLocal cterm=undercurl ctermbg=NONE ctermfg=NONE + endif + endif + hi Pmenu ctermfg=fg ctermbg=90 + hi PmenuSel ctermfg=16 ctermbg=252 cterm=NONE + hi PmenuSbar ctermfg=fg ctermbg=18 cterm=NONE + hi PmenuThumb ctermfg=fg ctermbg=28 cterm=NONE + hi TabLine ctermfg=fg ctermbg=28 cterm=NONE + hi TabLineFill ctermfg=fg ctermbg=28 cterm=NONE + hi TabLineSel ctermfg=fg ctermbg=NONE cterm=NONE + hi CursorColumn ctermfg=NONE ctermbg=88 cterm=NONE + hi CursorLine ctermfg=NONE ctermbg=NONE cterm=underline + hi MatchParen ctermfg=NONE ctermbg=90 + hi TabLine cterm=underline + hi TabLineFill cterm=underline + hi Underlined cterm=underline + hi CursorLine cterm=underline + endif + + endif " t_Co + + " }}}2 +endif + +" Links: +" +" COLOR LINKS DEFINE START + +hi link String Constant +" Character must be different from strings because in many languages +" (especially C, C++) a 'char' variable is scalar while 'string' is pointer, +" mistaken a 'char' for a 'string' will cause disaster! +hi link Character Number +hi link SpecialChar LineNr +hi link Tag Identifier +hi link cCppOut LineNr +" The following are not standard hi links, +" these are used by DrChip +hi link Warning MoreMsg +hi link Notice Constant +" these are used by Calendar +hi link CalToday PreProc +" these are used by TagList +hi link MyTagListTagName IncSearch +hi link MyTagListTagScope Constant + +" COLOR LINKS DEFINE END + +" vim:et:nosta:sw=2:ts=8: +" vim600:fdm=marker:fdl=1: diff -r 000000000000 -r 48859d9c82c5 vim/vimfiles/colors/peaksea2.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/vimfiles/colors/peaksea2.vim Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,601 @@ +" Vim color file --- psc (peak sea color) "Lite version" +" Maintainer: Pan, Shi Zhu +" URL: http://vim.sourceforge.net/scripts/script.php?script_id=760 +" Last Change: 5 Feb 2010 +" Version: 3.4 +" +" Comments and e-mails are welcomed, thanks. +" +" The peaksea color is simply a colorscheme with the default settings of +" the original ps_color. Lite version means there's no custom settings +" and fancy features such as integration with reloaded.vim +" +" The full version of ps_color.vim will be maintained until Vim 8. +" By then there will be only the lite version: peaksea.vim +" +" Note: Please set the background option in your .vimrc and/or .gvimrc +" +" It is much better *not* to set 'background' option inside +" a colorscheme file. because ":set background" improperly +" may cause colorscheme be sourced twice +" +" Color Scheme Overview: +" :ru syntax/hitest.vim +" +" Relevant Help: +" :h highlight-groups +" :h psc-cterm-color-table +" +" Colors Order: +" #rrggbb +" + +hi clear + +if exists("syntax_on") + syntax reset +endif + +let g:colors_name = expand(":t:r") + +" I don't want to abuse folding, but here folding is used to avoid confusion. +if &background=='light' + " for background=light {{{2 + " LIGHT COLOR DEFINE START + + hi Normal guifg=#000000 guibg=#e0e0e0 gui=NONE + hi Search guifg=NONE guibg=#f8f8f8 gui=NONE + hi Visual guifg=NONE guibg=#a6caf0 gui=NONE + hi Cursor guifg=#f0f0f0 guibg=#008000 gui=NONE + " The idea of CursorIM is pretty good, however, the feature is still buggy + " in the current version (Vim 7.0). + " The following line will be kept commented until the bug fixed. + " + " hi CursorIM guifg=#f0f0f0 guibg=#800080 + hi Special guifg=#907000 guibg=NONE gui=NONE + hi Comment guifg=#606000 guibg=NONE gui=NONE + hi Number guifg=#907000 guibg=NONE gui=NONE + hi Constant guifg=#007068 guibg=NONE gui=NONE + hi StatusLine guifg=fg guibg=#a6caf0 gui=NONE + hi LineNr guifg=#686868 guibg=NONE gui=NONE + hi Question guifg=fg guibg=#d0d090 gui=NONE + hi PreProc guifg=#009030 guibg=NONE gui=NONE + hi Statement guifg=#2060a8 guibg=NONE gui=NONE + hi Type guifg=#0850a0 guibg=NONE gui=NONE + hi Todo guifg=#800000 guibg=#e0e090 gui=NONE + " NOTE THIS IS IN THE WARM SECTION + hi Error guifg=#c03000 guibg=NONE gui=NONE + hi Identifier guifg=#a030a0 guibg=NONE gui=NONE + hi ModeMsg guifg=fg guibg=#b0b0e0 gui=NONE + hi VisualNOS guifg=fg guibg=#b0b0e0 gui=NONE + hi SpecialKey guifg=#1050a0 guibg=NONE gui=NONE + hi NonText guifg=#002090 guibg=#d0d0d0 gui=NONE + hi Directory guifg=#a030a0 guibg=NONE gui=NONE + hi ErrorMsg guifg=fg guibg=#f0b090 gui=NONE + hi MoreMsg guifg=#489000 guibg=NONE gui=NONE + hi Title guifg=#a030a0 guibg=NONE gui=NONE + hi WarningMsg guifg=#b02000 guibg=NONE gui=NONE + hi WildMenu guifg=fg guibg=#d0d090 gui=NONE + hi Folded guifg=NONE guibg=#b0e0b0 gui=NONE + hi FoldColumn guifg=fg guibg=#90e090 gui=NONE + hi DiffAdd guifg=NONE guibg=#b0b0e0 gui=NONE + hi DiffChange guifg=NONE guibg=#e0b0e0 gui=NONE + hi DiffDelete guifg=#002090 guibg=#d0d0d0 gui=NONE + hi DiffText guifg=NONE guibg=#c0e080 gui=NONE + hi SignColumn guifg=fg guibg=#90e090 gui=NONE + + hi IncSearch guifg=#f0f0f0 guibg=#806060 gui=NONE + hi StatusLineNC guifg=fg guibg=#c0c0c0 gui=NONE + hi VertSplit guifg=fg guibg=#c0c0c0 gui=NONE + hi Underlined guifg=#6a5acd guibg=NONE gui=underline + hi Ignore guifg=bg guibg=NONE + " NOTE THIS IS IN THE WARM SECTION + if v:version >= 700 + if has('spell') + hi SpellBad guifg=NONE guibg=NONE guisp=#c03000 + hi SpellCap guifg=NONE guibg=NONE guisp=#2060a8 + hi SpellRare guifg=NONE guibg=NONE guisp=#a030a0 + hi SpellLocal guifg=NONE guibg=NONE guisp=#007068 + endif + hi Pmenu guifg=fg guibg=#e0b0e0 + hi PmenuSel guifg=#f0f0f0 guibg=#806060 gui=NONE + hi PmenuSbar guifg=fg guibg=#c0c0c0 gui=NONE + hi PmenuThumb guifg=fg guibg=#c0e080 gui=NONE + hi TabLine guifg=fg guibg=#c0c0c0 gui=NONE + hi TabLineFill guifg=fg guibg=#c0c0c0 gui=NONE + hi TabLineSel guifg=fg guibg=NONE gui=NONE + hi CursorColumn guifg=NONE guibg=#f0b090 + hi CursorLine guifg=NONE guibg=NONE gui=underline + hi MatchParen guifg=NONE guibg=#c0e080 + endif + + " LIGHT COLOR DEFINE END + + " Vim 7 added stuffs + if v:version >= 700 + hi Ignore gui=NONE + + " the gui=undercurl guisp could only support in Vim 7 + if has('spell') + hi SpellBad gui=undercurl + hi SpellCap gui=undercurl + hi SpellRare gui=undercurl + hi SpellLocal gui=undercurl + endif + hi TabLine gui=underline + hi TabLineFill gui=underline + hi CursorLine gui=underline + endif + + " For reversed stuffs, clear the reversed prop and set the bold prop again + hi IncSearch gui=bold + hi StatusLine gui=bold + hi StatusLineNC gui=bold + hi VertSplit gui=bold + hi Visual gui=bold + + " Enable the bold property + hi Question gui=bold + hi DiffText gui=bold + hi Statement gui=bold + hi Type gui=bold + hi MoreMsg gui=bold + hi ModeMsg gui=bold + hi NonText gui=bold + hi Title gui=bold + hi DiffDelete gui=bold + hi TabLineSel gui=bold + + " gui define for background=light end here + + " generally, a dumb terminal is dark, we assume the light terminal has 256 + " color support. + if &t_Co==8 || &t_Co==16 + set t_Co=256 + endif + if &t_Co==256 + " 256color light terminal support here + + hi Normal ctermfg=16 ctermbg=254 cterm=NONE + " Comment/Uncomment the following line to disable/enable transparency + "hi Normal ctermfg=16 ctermbg=NONE cterm=NONE + hi Search ctermfg=NONE ctermbg=231 cterm=NONE + hi Visual ctermfg=NONE ctermbg=153 cterm=NONE + hi Cursor ctermfg=255 ctermbg=28 cterm=NONE + " hi CursorIM ctermfg=255 ctermbg=90 + hi Special ctermfg=94 ctermbg=NONE cterm=NONE + hi Comment ctermfg=58 ctermbg=NONE cterm=NONE + hi Number ctermfg=94 ctermbg=NONE cterm=NONE + hi Constant ctermfg=23 ctermbg=NONE cterm=NONE + hi StatusLine ctermfg=fg ctermbg=153 cterm=NONE + hi LineNr ctermfg=242 ctermbg=NONE cterm=NONE + hi Question ctermfg=fg ctermbg=186 cterm=NONE + hi PreProc ctermfg=29 ctermbg=NONE cterm=NONE + hi Statement ctermfg=25 ctermbg=NONE cterm=NONE + hi Type ctermfg=25 ctermbg=NONE cterm=NONE + hi Todo ctermfg=88 ctermbg=186 cterm=NONE + " NOTE THIS IS IN THE WARM SECTION + hi Error ctermfg=130 ctermbg=NONE cterm=NONE + hi Identifier ctermfg=133 ctermbg=NONE cterm=NONE + hi ModeMsg ctermfg=fg ctermbg=146 cterm=NONE + hi VisualNOS ctermfg=fg ctermbg=146 cterm=NONE + hi SpecialKey ctermfg=25 ctermbg=NONE cterm=NONE + hi NonText ctermfg=18 ctermbg=252 cterm=NONE + " Comment/Uncomment the following line to disable/enable transparency + "hi NonText ctermfg=18 ctermbg=NONE cterm=NONE + hi Directory ctermfg=133 ctermbg=NONE cterm=NONE + hi ErrorMsg ctermfg=fg ctermbg=216 cterm=NONE + hi MoreMsg ctermfg=64 ctermbg=NONE cterm=NONE + hi Title ctermfg=133 ctermbg=NONE cterm=NONE + hi WarningMsg ctermfg=124 ctermbg=NONE cterm=NONE + hi WildMenu ctermfg=fg ctermbg=186 cterm=NONE + hi Folded ctermfg=NONE ctermbg=151 cterm=NONE + hi FoldColumn ctermfg=fg ctermbg=114 cterm=NONE + hi DiffAdd ctermfg=NONE ctermbg=146 cterm=NONE + hi DiffChange ctermfg=NONE ctermbg=182 cterm=NONE + hi DiffDelete ctermfg=18 ctermbg=252 cterm=NONE + hi DiffText ctermfg=NONE ctermbg=150 cterm=NONE + hi SignColumn ctermfg=fg ctermbg=114 cterm=NONE + + hi IncSearch ctermfg=255 ctermbg=95 cterm=NONE + hi StatusLineNC ctermfg=fg ctermbg=250 cterm=NONE + hi VertSplit ctermfg=fg ctermbg=250 cterm=NONE + hi Underlined ctermfg=62 ctermbg=NONE cterm=underline + hi Ignore ctermfg=bg ctermbg=NONE + " NOTE THIS IS IN THE WARM SECTION + if v:version >= 700 + if has('spell') + if 0 + " ctermsp is not supported in Vim7, we ignore it. + hi SpellBad cterm=undercurl ctermbg=NONE ctermfg=130 + hi SpellCap cterm=undercurl ctermbg=NONE ctermfg=25 + hi SpellRare cterm=undercurl ctermbg=NONE ctermfg=133 + hi SpellLocal cterm=undercurl ctermbg=NONE ctermfg=23 + else + hi SpellBad cterm=undercurl ctermbg=NONE ctermfg=NONE + hi SpellCap cterm=undercurl ctermbg=NONE ctermfg=NONE + hi SpellRare cterm=undercurl ctermbg=NONE ctermfg=NONE + hi SpellLocal cterm=undercurl ctermbg=NONE ctermfg=NONE + endif + endif + hi Pmenu ctermfg=fg ctermbg=182 + hi PmenuSel ctermfg=255 ctermbg=95 cterm=NONE + hi PmenuSbar ctermfg=fg ctermbg=250 cterm=NONE + hi PmenuThumb ctermfg=fg ctermbg=150 cterm=NONE + hi TabLine ctermfg=fg ctermbg=250 cterm=NONE + hi TabLineFill ctermfg=fg ctermbg=250 cterm=NONE + hi TabLineSel ctermfg=fg ctermbg=NONE cterm=NONE + hi CursorColumn ctermfg=NONE ctermbg=216 + hi CursorLine ctermfg=NONE ctermbg=NONE cterm=underline + hi MatchParen ctermfg=NONE ctermbg=150 + endif + + hi TabLine cterm=underline + hi TabLineFill cterm=underline + hi CursorLine cterm=underline + + " For reversed stuffs, clear the reversed prop and set the bold prop again + hi IncSearch cterm=bold + hi StatusLine cterm=bold + hi StatusLineNC cterm=bold + hi VertSplit cterm=bold + hi Visual cterm=bold + + hi NonText cterm=bold + hi Question cterm=bold + hi Title cterm=bold + hi DiffDelete cterm=bold + hi DiffText cterm=bold + hi Statement cterm=bold + hi Type cterm=bold + hi MoreMsg cterm=bold + hi ModeMsg cterm=bold + hi TabLineSel cterm=bold + + "hi lCursor ctermfg=bg ctermbg=fg cterm=NONE + endif " t_Co==256 + " }}}2 +elseif &background=='dark' + " for background=dark {{{2 + " DARK COLOR DEFINE START + + hi Normal guifg=#d0d0d0 guibg=#202020 gui=NONE + hi Comment guifg=#d0d090 guibg=NONE gui=NONE + hi Constant guifg=#80c0e0 guibg=NONE gui=NONE + hi Number guifg=#e0c060 guibg=NONE gui=NONE + hi Identifier guifg=#f0c0f0 guibg=NONE gui=NONE + hi Statement guifg=#c0d8f8 guibg=NONE gui=NONE + hi PreProc guifg=#60f080 guibg=NONE gui=NONE + hi Type guifg=#b0d0f0 guibg=NONE gui=NONE + hi Special guifg=#e0c060 guibg=NONE gui=NONE + hi Error guifg=#f08060 guibg=#800000 gui=NONE + hi Todo guifg=#800000 guibg=#d0d090 gui=NONE + hi Search guifg=NONE guibg=#800000 gui=NONE + hi Visual guifg=#000000 guibg=#a6caf0 gui=NONE + hi Cursor guifg=#000000 guibg=#00f000 gui=NONE + " NOTE THIS IS IN THE COOL SECTION + " hi CursorIM guifg=#000000 guibg=#f000f0 gui=NONE + hi StatusLine guifg=#000000 guibg=#a6caf0 gui=NONE + hi LineNr guifg=#b0b0b0 guibg=NONE gui=NONE + hi Question guifg=#000000 guibg=#d0d090 gui=NONE + hi ModeMsg guifg=fg guibg=#000080 gui=NONE + hi VisualNOS guifg=fg guibg=#000080 gui=NONE + hi SpecialKey guifg=#b0d0f0 guibg=NONE gui=NONE + hi NonText guifg=#6080f0 guibg=#101010 gui=NONE + hi Directory guifg=#80c0e0 guibg=NONE gui=NONE + hi ErrorMsg guifg=#d0d090 guibg=#800000 gui=NONE + hi MoreMsg guifg=#c0e080 guibg=NONE gui=NONE + hi Title guifg=#f0c0f0 guibg=NONE gui=NONE + hi WarningMsg guifg=#f08060 guibg=NONE gui=NONE + hi WildMenu guifg=#000000 guibg=#d0d090 gui=NONE + hi Folded guifg=NONE guibg=#004000 gui=NONE + hi FoldColumn guifg=#e0e0e0 guibg=#008000 gui=NONE + hi DiffAdd guifg=NONE guibg=#000080 gui=NONE + hi DiffChange guifg=NONE guibg=#800080 gui=NONE + hi DiffDelete guifg=#6080f0 guibg=#202020 gui=NONE + hi DiffText guifg=#000000 guibg=#c0e080 gui=NONE + hi SignColumn guifg=#e0e0e0 guibg=#008000 gui=NONE + hi IncSearch guifg=#000000 guibg=#d0d0d0 gui=NONE + hi StatusLineNC guifg=#000000 guibg=#c0c0c0 gui=NONE + hi VertSplit guifg=#000000 guibg=#c0c0c0 gui=NONE + hi Underlined guifg=#80a0ff guibg=NONE gui=underline + hi Ignore guifg=#000000 guibg=NONE + " NOTE THIS IS IN THE COOL SECTION + if v:version >= 700 + if has('spell') + " the guisp= could only support in Vim 7 + hi SpellBad guifg=NONE guibg=NONE guisp=#f08060 + hi SpellCap guifg=NONE guibg=NONE guisp=#6080f0 + hi SpellRare guifg=NONE guibg=NONE guisp=#f0c0f0 + hi SpellLocal guifg=NONE guibg=NONE guisp=#c0d8f8 + endif + hi Pmenu guifg=fg guibg=#800080 + hi PmenuSel guifg=#000000 guibg=#d0d0d0 gui=NONE + hi PmenuSbar guifg=fg guibg=#000080 gui=NONE + hi PmenuThumb guifg=fg guibg=#008000 gui=NONE + hi TabLine guifg=fg guibg=#008000 gui=NONE + hi TabLineFill guifg=fg guibg=#008000 gui=NONE + hi TabLineSel guifg=fg guibg=NONE gui=NONE + hi CursorColumn guifg=NONE guibg=#800000 gui=NONE + hi CursorLine guifg=NONE guibg=NONE gui=underline + hi MatchParen guifg=NONE guibg=#800080 + endif + + " DARK COLOR DEFINE END + + " Vim 7 added stuffs + if v:version >= 700 + hi Ignore gui=NONE + + " the gui=undercurl could only support in Vim 7 + if has('spell') + hi SpellBad gui=undercurl + hi SpellCap gui=undercurl + hi SpellRare gui=undercurl + hi SpellLocal gui=undercurl + endif + hi TabLine gui=underline + hi TabLineFill gui=underline + hi Underlined gui=underline + hi CursorLine gui=underline + endif + + " gui define for background=dark end here + + if &t_Co==8 || &t_Co==16 + " for 8-color and 16-color term + hi Normal ctermfg=LightGrey ctermbg=Black + hi Special ctermfg=Yellow ctermbg=bg + hi Comment ctermfg=DarkYellow ctermbg=bg + hi Constant ctermfg=Blue ctermbg=bg + hi Number ctermfg=Yellow ctermbg=bg + hi LineNr ctermfg=DarkGrey ctermbg=bg + hi PreProc ctermfg=Green ctermbg=bg + hi Statement ctermfg=Cyan ctermbg=bg + hi Type ctermfg=Cyan ctermbg=bg + hi Error ctermfg=Red ctermbg=DarkRed + hi Identifier ctermfg=Magenta ctermbg=bg + hi SpecialKey ctermfg=Cyan ctermbg=bg + hi NonText ctermfg=Blue ctermbg=bg + hi Directory ctermfg=Blue ctermbg=bg + hi MoreMsg ctermfg=Green ctermbg=bg + hi Title ctermfg=Magenta ctermbg=bg + hi WarningMsg ctermfg=Red ctermbg=bg + hi DiffDelete ctermfg=Blue ctermbg=bg + + hi Search ctermfg=NONE ctermbg=DarkRed + hi Visual ctermfg=Black ctermbg=DarkCyan + hi Cursor ctermfg=Black ctermbg=Green + hi StatusLine ctermfg=Black ctermbg=DarkCyan + hi Question ctermfg=Black ctermbg=DarkYellow + hi Todo ctermfg=DarkRed ctermbg=DarkYellow + hi Folded ctermfg=White ctermbg=DarkGreen + hi ModeMsg ctermfg=Grey ctermbg=DarkBlue + hi VisualNOS ctermfg=Grey ctermbg=DarkBlue + hi ErrorMsg ctermfg=DarkYellow ctermbg=DarkRed + hi WildMenu ctermfg=Black ctermbg=DarkYellow + hi FoldColumn ctermfg=White ctermbg=DarkGreen + hi SignColumn ctermfg=White ctermbg=DarkGreen + hi DiffText ctermfg=Black ctermbg=DarkYellow + + if v:version >= 700 + if has('spell') + hi SpellBad ctermfg=NONE ctermbg=DarkRed + hi SpellCap ctermfg=NONE ctermbg=DarkBlue + hi SpellRare ctermfg=NONE ctermbg=DarkMagenta + hi SpellLocal ctermfg=NONE ctermbg=DarkGreen + endif + hi Pmenu ctermfg=fg ctermbg=DarkMagenta + hi PmenuSel ctermfg=Black ctermbg=fg + hi PmenuSbar ctermfg=fg ctermbg=DarkBlue + hi PmenuThumb ctermfg=fg ctermbg=DarkGreen + hi TabLine ctermfg=fg ctermbg=DarkGreen cterm=underline + hi TabLineFill ctermfg=fg ctermbg=DarkGreen cterm=underline + hi CursorColumn ctermfg=NONE ctermbg=DarkRed + + hi TabLineSel ctermfg=fg ctermbg=bg + hi CursorLine ctermfg=NONE ctermbg=bg cterm=underline + + hi MatchParen ctermfg=NONE ctermbg=DarkMagenta + endif + if &t_Co==8 + " 8 colour terminal support, this assumes 16 colour is available through + " setting the 'bold' attribute, will get bright foreground colour. + " However, the bright background color is not available for 8-color terms. + " + " You can manually set t_Co=16 in your .vimrc to see if your terminal + " supports 16 colours, + hi DiffText cterm=none + hi Visual cterm=none + hi Cursor cterm=none + hi Comment cterm=none + hi Todo cterm=none + hi StatusLine cterm=none + hi Question cterm=none + hi DiffChange cterm=none + hi ModeMsg cterm=none + hi VisualNOS cterm=none + hi ErrorMsg cterm=none + hi WildMenu cterm=none + hi DiffAdd cterm=none + hi Folded cterm=none + hi DiffDelete cterm=none + hi Normal cterm=none + hi PmenuThumb cterm=none + hi Search cterm=bold + hi Special cterm=bold + hi Constant cterm=bold + hi Number cterm=bold + hi LineNr cterm=bold + hi PreProc cterm=bold + hi Statement cterm=bold + hi Type cterm=bold + hi Error cterm=bold + hi Identifier cterm=bold + hi SpecialKey cterm=bold + hi NonText cterm=bold + hi MoreMsg cterm=bold + hi Title cterm=bold + hi WarningMsg cterm=bold + hi FoldColumn cterm=bold + hi SignColumn cterm=bold + hi Directory cterm=bold + hi DiffDelete cterm=bold + else + " Background > 7 is only available with 16 or more colors + + hi WarningMsg cterm=none + hi Search cterm=none + hi Visual cterm=none + hi Cursor cterm=none + hi Special cterm=none + hi Comment cterm=none + hi Constant cterm=none + hi Number cterm=none + hi LineNr cterm=none + hi PreProc cterm=none + hi Todo cterm=none + hi Error cterm=none + hi Identifier cterm=none + hi Folded cterm=none + hi SpecialKey cterm=none + hi Directory cterm=none + hi ErrorMsg cterm=none + hi Normal cterm=none + hi PmenuThumb cterm=none + hi WildMenu cterm=none + hi FoldColumn cterm=none + hi SignColumn cterm=none + hi DiffAdd cterm=none + hi DiffChange cterm=none + hi Question cterm=none + hi StatusLine cterm=none + hi DiffText cterm=none + hi IncSearch cterm=reverse + hi StatusLineNC cterm=reverse + hi VertSplit cterm=reverse + + " Well, well, bold font with color 0-7 is not possible. + " So, the Question, StatusLine, DiffText cannot act as expected. + + hi Statement cterm=none + hi Type cterm=none + hi MoreMsg cterm=none + hi ModeMsg cterm=none + hi NonText cterm=none + hi Title cterm=none + hi VisualNOS cterm=none + hi DiffDelete cterm=none + hi TabLineSel cterm=none + + endif + elseif &t_Co==256 + " 256color dark terminal support here + hi Normal ctermfg=252 ctermbg=234 cterm=NONE + " Comment/Uncomment the following line to disable/enable transparency + "hi Normal ctermfg=252 ctermbg=NONE cterm=NONE + hi Comment ctermfg=186 ctermbg=NONE cterm=NONE + hi Constant ctermfg=110 ctermbg=NONE cterm=NONE + hi Number ctermfg=179 ctermbg=NONE cterm=NONE + hi Identifier ctermfg=219 ctermbg=NONE cterm=NONE + hi Statement ctermfg=153 ctermbg=NONE cterm=NONE + hi PreProc ctermfg=84 ctermbg=NONE cterm=NONE + hi Type ctermfg=153 ctermbg=NONE cterm=NONE + hi Special ctermfg=179 ctermbg=NONE cterm=NONE + hi Error ctermfg=209 ctermbg=88 cterm=NONE + hi Todo ctermfg=88 ctermbg=186 cterm=NONE + hi Search ctermfg=NONE ctermbg=88 cterm=NONE + hi Visual ctermfg=16 ctermbg=153 cterm=NONE + hi Cursor ctermfg=16 ctermbg=46 cterm=NONE + " NOTE THIS IS IN THE COOL SECTION + " hi CursorIM ctermfg=16 ctermbg=201 cterm=NONE + hi StatusLine ctermfg=16 ctermbg=153 cterm=NONE + hi LineNr ctermfg=249 ctermbg=NONE cterm=NONE + hi Question ctermfg=16 ctermbg=186 cterm=NONE + hi ModeMsg ctermfg=fg ctermbg=18 cterm=NONE + hi VisualNOS ctermfg=fg ctermbg=18 cterm=NONE + hi SpecialKey ctermfg=153 ctermbg=NONE cterm=NONE + hi NonText ctermfg=69 ctermbg=233 cterm=NONE + " Comment/Uncomment the following line to disable/enable transparency + "hi NonText ctermfg=69 ctermbg=NONE cterm=NONE + hi Directory ctermfg=110 ctermbg=NONE cterm=NONE + hi ErrorMsg ctermfg=186 ctermbg=88 cterm=NONE + hi MoreMsg ctermfg=150 ctermbg=NONE cterm=NONE + hi Title ctermfg=219 ctermbg=NONE cterm=NONE + hi WarningMsg ctermfg=209 ctermbg=NONE cterm=NONE + hi WildMenu ctermfg=16 ctermbg=186 cterm=NONE + hi Folded ctermfg=NONE ctermbg=22 cterm=NONE + hi FoldColumn ctermfg=254 ctermbg=28 cterm=NONE + hi DiffAdd ctermfg=NONE ctermbg=18 cterm=NONE + hi DiffChange ctermfg=NONE ctermbg=90 cterm=NONE + hi DiffDelete ctermfg=69 ctermbg=234 cterm=NONE + hi DiffText ctermfg=16 ctermbg=150 cterm=NONE + hi SignColumn ctermfg=254 ctermbg=28 cterm=NONE + hi IncSearch ctermfg=16 ctermbg=252 cterm=NONE + hi StatusLineNC ctermfg=16 ctermbg=250 cterm=NONE + hi VertSplit ctermfg=16 ctermbg=250 cterm=NONE + hi Underlined ctermfg=111 ctermbg=NONE cterm=underline + hi Ignore ctermfg=16 ctermbg=NONE + " NOTE THIS IS IN THE COOL SECTION + if v:version >= 700 + if has('spell') + " the ctermsp= is not supported in Vim 7 we simply ignored + if 0 + hi SpellBad cterm=undercurl ctermbg=NONE ctermfg=209 + hi SpellCap cterm=undercurl ctermbg=NONE ctermfg=69 + hi SpellRare cterm=undercurl ctermbg=NONE ctermfg=219 + hi SpellLocal cterm=undercurl ctermbg=NONE ctermfg=153 + else + hi SpellBad cterm=undercurl ctermbg=NONE ctermfg=NONE + hi SpellCap cterm=undercurl ctermbg=NONE ctermfg=NONE + hi SpellRare cterm=undercurl ctermbg=NONE ctermfg=NONE + hi SpellLocal cterm=undercurl ctermbg=NONE ctermfg=NONE + endif + endif + hi Pmenu ctermfg=fg ctermbg=90 + hi PmenuSel ctermfg=16 ctermbg=252 cterm=NONE + hi PmenuSbar ctermfg=fg ctermbg=18 cterm=NONE + hi PmenuThumb ctermfg=fg ctermbg=28 cterm=NONE + hi TabLine ctermfg=fg ctermbg=28 cterm=NONE + hi TabLineFill ctermfg=fg ctermbg=28 cterm=NONE + hi TabLineSel ctermfg=fg ctermbg=NONE cterm=NONE + hi CursorColumn ctermfg=NONE ctermbg=88 cterm=NONE + hi CursorLine ctermfg=NONE ctermbg=NONE cterm=underline + hi MatchParen ctermfg=NONE ctermbg=90 + hi TabLine cterm=underline + hi TabLineFill cterm=underline + hi Underlined cterm=underline + hi CursorLine cterm=underline + endif + + endif " t_Co + + " }}}2 +endif + +" Links: +" +" COLOR LINKS DEFINE START + +hi link String Constant +" Character must be different from strings because in many languages +" (especially C, C++) a 'char' variable is scalar while 'string' is pointer, +" mistaken a 'char' for a 'string' will cause disaster! +hi link Character Number +hi link SpecialChar LineNr +hi link Tag Identifier +hi link cCppOut LineNr +" The following are not standard hi links, +" these are used by DrChip +hi link Warning MoreMsg +hi link Notice Constant +" these are used by Calendar +hi link CalToday PreProc +" these are used by TagList +hi link MyTagListTagName IncSearch +hi link MyTagListTagScope Constant + +" COLOR LINKS DEFINE END + +" vim:et:nosta:sw=2:ts=8: +" vim600:fdm=marker:fdl=1: diff -r 000000000000 -r 48859d9c82c5 vim/vimfiles/doc/ctrlp.txt --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/vimfiles/doc/ctrlp.txt Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,670 @@ +*ctrlp.txt* Fuzzy file, buffer, mru and tag finder. v1.6.4 +*CtrlP* *ControlP* *'ctrlp'* *'ctrl-p'* +=============================================================================== +# # +# :::::::: ::::::::::: ::::::::: ::: ::::::::: # +# :+: :+: :+: :+: :+: :+: :+: :+: # +# +:+ +:+ +:+ +:+ +:+ +:+ +:+ # +# +#+ +#+ +#++:++#: +#+ +#++:++#+ # +# +#+ +#+ +#+ +#+ +#+ +#+ # +# #+# #+# #+# #+# #+# #+# #+# # +# ######## ### ### ### ########## ### # +# # +=============================================================================== +CONTENTS *ctrlp-contents* + + 1. Intro........................................|ctrlp-intro| + 2. Options......................................|ctrlp-options| + 3. Commands.....................................|ctrlp-commands| + 4. Mappings.....................................|ctrlp-mappings| + 5. Input Formats................................|ctrlp-input-formats| + 6. Extensions...................................|ctrlp-extensions| + +=============================================================================== +1. Intro *ctrlp-intro* + +Full path fuzzy file, buffer and MRU file finder with an intuitive interface. +Written in pure Vimscript for MacVim and Vim version 7.0+. Has full support for +Vim’s |regexp| as search pattern, built-in MRU monitoring, project’s root +finder, and more. + +To enable optional extensions (tag, quickfix, dir...), see |ctrlp-extensions|. + +=============================================================================== +2. Options *ctrlp-options* + +Below are the available options and their default values:~ + + *'g:ctrlp_map'* +Use this option to change the mapping to invoke |CtrlP| in |Normal| mode: > + let g:ctrlp_map = '' +< + + *'g:loaded_ctrlp'* +Use this option to disable the plugin completely: > + let g:loaded_ctrlp = 1 +< + + *'g:ctrlp_by_filename'* +Set this to 1 to set search by filename (not full path) as the default: > + let g:ctrlp_by_filename = 0 +< + + *'g:ctrlp_regexp_search'* +Set this to 1 to set |regexp| search as the default: > + let g:ctrlp_regexp_search = 0 +< + + *'g:ctrlp_match_window_bottom'* +Set this to 0 to show the match window at the top of the screen: > + let g:ctrlp_match_window_bottom = 1 +< + + *'g:ctrlp_match_window_reversed'* +Reverse the sort order of the matched files in the match window. The default +setting is from bottom to top: > + let g:ctrlp_match_window_reversed = 1 +< + + *'g:ctrlp_max_height'* +Set the maximum height of the match window: > + let g:ctrlp_max_height = 10 +< + + *'g:ctrlp_jump_to_buffer'* +Set this to 0 to disable the jump-to-open-buffer feature. Set to 2 to also jump +tab if the selected buffer’s opened in another tab: > + let g:ctrlp_jump_to_buffer = 1 +< + + *'g:ctrlp_working_path_mode'* +When starting up the prompt, temporarily set the working directory (i.e. the +|current-directory|) to: + 1 - the parent directory of the current file. + 2 - the nearest ancestor that contains one of these directories/files: + .git/ + .hg/ + .bzr/ + _darcs/ + root.dir + .vimprojects + 0 - don’t manage working directory. +> + let g:ctrlp_working_path_mode = 2 +< + + *'g:ctrlp_root_markers'* +Use this to set your own root markers in addition to the default ones. Your +markers will take precedence: > + let g:ctrlp_root_markers = [''] +< +These markers (builtins and yours) will serve as identifiers for the '/' and +'\' special inputs (section 5.e) + + *'g:ctrlp_use_caching'* +Set this to 0 to disable per-session caching. When disabled, caching will still +be enabled for directories that have more than 4000 files: > + let g:ctrlp_use_caching = 1 +< +Note: you can quickly purge the cache by pressing while inside |CtrlP|. + + *'g:ctrlp_clear_cache_on_exit'* +Set this to 0 to enable cross-sessions caching: > + let g:ctrlp_clear_cache_on_exit = 1 +< + + *'g:ctrlp_cache_dir'* +Set the directory to store the cache files: > + let g:ctrlp_cache_dir = $HOME.'/.ctrlp_cache' +< + + *'g:ctrlp_prompt_mappings'* +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 []): > + let g:ctrlp_prompt_mappings = { + \ 'PrtBS()': [''], + \ 'PrtDelete()': [''], + \ 'PrtDeleteWord()': [''], + \ 'PrtClear()': [''], + \ 'PrtSelectMove("j")': ['', ''], + \ 'PrtSelectMove("k")': ['', ''], + \ 'PrtHistory(-1)': [''], + \ 'PrtHistory(1)': [''], + \ 'AcceptSelection("e")': ['', '<2-LeftMouse>'], + \ 'AcceptSelection("h")': ['', '', ''], + \ 'AcceptSelection("t")': ['', ''], + \ 'AcceptSelection("v")': ['', '', ''], + \ 'ToggleFocus()': [''], + \ 'ToggleRegex()': [''], + \ 'ToggleByFname()': [''], + \ 'ToggleType(1)': ['', '', ''], + \ 'PrtCurStart()': [''], + \ 'PrtCurEnd()': [''], + \ 'PrtCurLeft()': ['', ''], + \ 'PrtCurRight()': ['', ''], + \ 'PrtClearCache()': [''], + \ 'PrtDeleteMRU()': [''], + \ 'CreateNewFile()': [''], + \ 'MarkToOpen()': [''], + \ 'OpenMulti()': [''], + \ 'PrtExit()': ['', '', ''], + \ } +< +If you have problem with moving left instead of deleting a char, add this +to your |vimrc|: > + let g:ctrlp_prompt_mappings = { + \ 'PrtBS()': [''], + \ 'PrtCurLeft()': [''], + \ } +< + + *'g:ctrlp_mruf_max'* +Specify the number of recently opened files you want |CtrlP| to remember: > + let g:ctrlp_mruf_max = 250 +< + + *'g:ctrlp_mruf_exclude'* +Files you don’t want |CtrlP| to remember; use |regexp| to specify the patterns: +> + let g:ctrlp_mruf_exclude = '' +< +Examples: > + let g:ctrlp_mruf_exclude = '/tmp/.*\|/temp/.*' " MacOSX/Linux + let g:ctrlp_mruf_exclude = '^C:\\dev\\tmp\\.*' " Windows +< + + *'g:ctrlp_mruf_include'* +And if you want |CtrlP| to only remember some files, specify them here: > + let g:ctrlp_mruf_include = '' +< +Example: > + let g:ctrlp_mruf_include = '\.py$\|\.rb$' +< + + *'g:ctrlp_mruf_case_sensitive'* +Match this with your file system case-sensitivity setting to avoid duplicate +MRU entries: > + let g:ctrlp_mruf_case_sensitive = 1 +< + + *'g:ctrlp_dotfiles'* +Set this to 0 if you don’t want |CtrlP| to search for dotfiles and dotdirs: > + let g:ctrlp_dotfiles = 1 +< +You can also use |'wildignore'| to exclude anything from the search. +e.g. exclude version control directories from the results: > + set wildignore+=*/.git/*,*/.hg/*,*/.svn/* " Linux/MacOSX + set wildignore+=.git\*,.hg\*,.svn\* " Windows +< +Note: the `*/` in front of each dotfile glob is required for the dotfiles +search feature to work correctly along side with |wildignore|. If you’ve +disabled dotfiles search (set |g:ctrlp_dotfiles| to 0), then you can ignore +this. + +Other note: |wildignore| influences the result of |expand()|, |globpath()| and +|glob()| which many plugins use to find stuff on the system (e.g. fugitive.vim +looks for .git/, some other plugins look for external exe tools on Windows). +So be a little mindful of what you put in your |wildignore|. + + *'g:ctrlp_highlight_match'* +Use this to enable/disable highlighting of the matched patterns and to specify +the highlight group that’ll be used: > + let g:ctrlp_highlight_match = [1, 'Identifier'] +< + + *'g:ctrlp_max_files'* +The maximum number of files to scan, set to 0 for no limit: > + let g:ctrlp_max_files = 20000 +< + + *'g:ctrlp_max_depth'* +The maximum depth of a directory tree to recurse into: > + let g:ctrlp_max_depth = 40 +< +Note: the larger these values, the more memory Vim uses. + + *'g:ctrlp_user_command'* +Specify an external tool to use for listing files instead of Vim’s globpath(). +Use %s in place of the target directory: > + let g:ctrlp_user_command = '' +< +Examples: > + let g:ctrlp_user_command = 'find %s -type f' " MacOSX/Linux + let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d' " Windows +< +You can also use 'grep', 'findstr' or something else to filter the results. +Examples: > + let g:ctrlp_user_command = 'find %s -type f | grep (?!tmp/.*)' + let g:ctrlp_user_command = 'dir %s /-n /b /s /a-d | findstr .*\.py$' +< +Use a version control listing command when inside a repository, this is a lot +faster when working with large projects: > + let g:ctrlp_user_command = [repo_marker, vcs_ls_command, fallback_command] +< +If the fallback_command is empty or not defined, globpath() will then be used +when searching outside a repo. +Examples: > + let g:ctrlp_user_command = ['.git/', 'cd %s && git ls-files'] + let g:ctrlp_user_command = ['.hg/', 'hg --cwd %s locate --fullpath -I .'] +< + + *'g:ctrlp_open_new_file'* +Use this option to specify how the newly created file is to be opened when +pressing : + 1 - in a new tab + 2 - in a new horizontal split + 3 - in a new vertical split + 0 - in the current window +> + let g:ctrlp_open_new_file = 3 +< + + *'g:ctrlp_max_history'* +The maximum number of input strings you want |CtrlP| to remember. The default +value mirrors Vim’s global |'history'| option: > + let g:ctrlp_max_history = &history +< +Set to 0 to disable prompt’s history. + + *'g:ctrlp_open_multi'* +If non-zero, this will enable opening multiple files with and : > + let g:ctrlp_open_multi = '1v' +< +For the number: + If bigger than 1, it’ll be used as the maximum number of windows or tabs to + create when opening the files (the rest will be hidden buffers). If is 1, + will open all files, each in a new window or new tab. +For the letter: + t - each in a tab + h - each in a horizontal split + v - each in a vertical split + + *'g:ctrlp_dont_split'* +When opening a file with , |CtrlP| avoids opening it in windows created by +plugins, help and quickfix. Use this to setup some exceptions: > + let g:ctrlp_dont_split = '' +< +Acceptable values are partial names or filetypes of the special buffers. Use +|regexp| to specify the pattern. Example: > + let g:ctrlp_dont_split = 'netrw\|help' +< + + *'g:ctrlp_follow_symlinks'* +Set this to 1 to follow symbolic links when listing files: > + let g:ctrlp_follow_symlinks = 0 +< + + *'g:ctrlp_lazy_update'* +Set this to 1 to enable the lazy-update feature: only update the match window +after typing’s been stopped for a certain amount of time: > + let g:ctrlp_lazy_update = 0 +< +If is 1, update after 250ms. If bigger than 1, the number will be used as the +delay time in milliseconds. + + *'g:ctrlp_use_migemo'* +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: > + let g:ctrlp_use_migemo = 0 +< + +=============================================================================== +3. Commands *ctrlp-commands* + + *:CtrlP* +:CtrlP [starting-directory] + Open |CtrlP| in find file mode. + + If no argument is given, the value of |g:ctrlp_working_path_mode| will be + used to determine the starting directory. + You can use to auto-complete the [starting-directory] when typing it. + + *:CtrlPBuffer* +:CtrlPBuffer + Open |CtrlP| in find buffer mode. + + *:CtrlPMRU* +:CtrlPMRU + Open |CtrlP| in find Most-Recently-Used file mode. + + *:ClearCtrlPCache* +:ClearCtrlPCache + Flush the cache for the current working directory. The same as pressing + inside |CtrlP|. + + *:ClearAllCtrlPCaches* +:ClearAllCtrlPCaches + Delete all the cache files saved in |ctrlp_cache_dir|. + + *:ResetCtrlP* +:ResetCtrlP + Reset all options, take in new values of the option variables in section 2. + +------------------------------------------------------------------------------- +The following commands ignore the current value of |g:ctrlp_working_path_mode|: + +:CtrlPCurWD *:CtrlPCurWD* + This acts like |:CtrlP| with |path_mode| = 0 + +:CtrlPCurFile *:CtrlPCurFile* + This acts like |:CtrlP| with |path_mode| = 1 + +:CtrlPRoot *:CtrlPRoot* + This acts like |:CtrlP| with |path_mode| = 2 + +=============================================================================== +4. Mappings *ctrlp-mappings* + + *'ctrlp-'* + + Default |Normal| mode mapping to open the |CtrlP| prompt in find file mode. + +Once inside the prompt:~ + + *'ctrlp-fullregexp'* + Toggle between the string mode (section 5.a & b) and full |regexp| mode. + (note: in full |regexp| mode, the prompt’s base is 'r>>' instead of '>>>') + + See also |input-formats| and |g:ctrlp_regexp_search|. + + + Toggle between full path search and filename only search. + (note: in filename mode, the prompt’s base is '>d>' instead of '>>>') + + , 'forward' + + Scroll to the 'next' search mode in the sequence. + + , 'backward' + + Scroll to the 'previous' search mode in the sequence. + + + Toggle the focus between the match window and the prompt. + + , + + Move selection down + + , + + Move selection up + + + Move the cursor to the 'start' of the prompt + + + Move the cursor to the 'end' of the prompt + + , + + Move the cursor one character to the 'left' + + , + + Move the cursor one character to the 'right' + + + Delete a preceding inner word + + + Clear the input field + + + Open selected file in the active window if possible. + + + Open selected file in a new 'tab' + + + Open selected file in a 'vertical' split + + , + , + + Open selected file in a 'horizontal' split + + + Create a new file and its parent directories. + + + Next string in the prompt’s history + + + Previous string in the prompt’s history + + + Mark/unmark a file to be opened with . + + + Open files marked by . + + + - Refresh the match window and purge the cache for the current directory. + - Remove deleted files from MRU list. + + + Clear MRU list. + + , + , + + Exit |CtrlP|. can also be used to stop the file scan. + +Choose your own mappings with |g:ctrlp_prompt_mappings|. + +When inside the match window (press to switch):~ + + a-z + 0-9 + ~^-=;`',.+!@#$%&_(){}[] + Cycle through the lines with the first letter (of paths or filenames) that + matches that key. + +=============================================================================== +5. Input Formats *ctrlp-input-formats* + +Formats for inputting in the prompt:~ + +a) Simple string. + 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 + a Vim’s |regexp| |pattern| without any modification. + e.g. 'abc\d*efg' will be read as 'abc\d*efg'. + + See also |ctrlp-fullregexp| (key map) and |g:ctrlp_regexp_search| (option). + +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 ':' in the command, + escape it with a backslash: '\:'. + e.g. 'abc:45' will open the selected file and jump to line 45. + 'abc:/my\:function' will open the selected file and jump to the first + instance of 'my:function'. + 'abc:+setf\ myfiletype|50' will open the selected file and set its + filetype to 'myfiletype' then jump to line 50. + + See also Vim’s |++opt| and |+cmd|. + +d) Type exactly two dots '..' at the start of the prompt and press enter to go + backward in the directory tree by 1 level. If the parent directory is + large, this might be slow. + +e) Similarly submit '/' or '\' to find and go to the project’s root. If the + project is large, using a VCS listing command to look for files might help + speeding up the intial scan (see |g:ctrlp_user_command| for more details). + +f) Type the name of a non-existent file and press to create it. + e.g. 'parentdir/file.txt' will create a directory named 'parentdir' as well + as 'file.txt'. + Use '\' in place of '/' on Windows (if |'ssl'| is not set). + +g) Submit ? to open this help file. + +=============================================================================== +6. Extensions *g:ctrlp-extensions* + +Extensions are optional. To enable an extension, add its name to the variable +g:ctrlp_extensions: > + let g:ctrlp_extensions = ['tag', 'quickfix', 'dir'] +< +The order of the items will be the order they appear on the statusline and when +using , . + +Available extensions:~ + + *:CtrlPTag* + * Tag mode:~ + - Name: 'tag' + - Command: ':CtrlPTag' + - 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 + locations of the tags file(s). Example: `set tags+=tags/help,doc/tags` + + *:CtrlPQuickfix* + * Quickfix mode:~ + - Name: 'quickfix' + - Command: ':CtrlPQuickfix' + - Search for an entry in the current quickfix errors and jump to it. + + *:CtrlPDir* + * Directory mode:~ + - Name: 'dir' + - Command: ':CtrlPDir' + - Search for a directory and change the working directory to it. + - Mappings: + + change the local working directory for |CtrlP| and keep it open. + + change the global working directory (exit). + + change the local working directory for the current window (exit). + + change the global working directory to |CtrlP|’s current local + working directory (exit). + +=============================================================================== +EXTENDING *ctrlp-extending* + +Extending |CtrlP| is very simple. Simply create a vim file following a short +guidelines, place it in autoload/ctrlp/ and add its name to your .vimrc. + +To see how it works, get the sample.vim from the extensions branch on the main +git repository (https://github.com/kien/ctrlp.vim/tree/extensions), and place +it along with the parent directories somewhere in your runtimepath. Then put +this into your .vimrc: > + let g:ctrlp_extensions = ['sample'] +< +A new search type will show up the next time you open |CtrlP|. + +For more details, check out the comments inside sample.vim.~ + +=============================================================================== +CREDITS *ctrlp-credits* + +Developed by Kien Nguyen , initially based on the Command-T +and the LustyExplorer plugins. No code was taken from these plugins, but I did +clone the majority of their (awesome) interfaces and the way they work. + +This was originally written as a module for a would-be larger plugin called +AutoDoc.vim which I’ve stopped developing because of lost of interest. I really +liked the way Command-T and LustyExplorer deal with user’s input, so I wrote a +pure Vimscript version of their prompt window, intended to use it for the +aforementioned plugin. + +Homepage: http://kien.github.com/ctrlp.vim +Git repository: https://github.com/kien/ctrlp.vim +Mercurial repository: https://bitbucket.org/kien/ctrlp.vim + +=============================================================================== +THANKS *ctrlp-thanks* + +Thanks to everyone that has submitted ideas, bug reports or helped debugging on +gibhub, bitbucket, and through email. + +Special thanks:~ + + * Woojong Koh + Forked and suggested the support for VCS listing commands. + + * Yasuhiro Matsumoto + Added option to use Migemo for Japanese language. + +=============================================================================== +CHANGELOG *ctrlp-changelog* + +Before 2011/11/30~ + + + New features: Tag, Quickfix and Directory extensions. + + New commands: |:CtrlPTag|, |:CtrlPQuickfix|, |:CtrlPDir|. + + New options: |g:ctrlp_use_migemo|, + |g:ctrlp_lazy_update|, + |g:ctrlp_follow_symlinks| + +Before 2011/11/13~ + + + New special input: '/' and '\' find root (section 5.e) + + Remove ctrlp#SetWorkingPath(). + + Remove |g:ctrlp_mru_files|, make MRU permanent. + + Extend |g:ctrlp_open_multi|, add new ways to open files. + + New option: |g:ctrlp_dont_split|, + |g:ctrlp_mruf_case_sensitive| + +Before 2011/10/30~ + + + New feature: Support for custom extensions. + also removes non-existent files from MRU list. + + New option: |g:ctrlp_jump_to_buffer| + +Before 2011/10/12~ + + + New features: Open multiple files. + Pass Vim’s |++opt| and |+cmd| to the opening file + (section 5.c) + Auto-complete each dir for |:CtrlP| [starting-directory] + + New mappings: mark/unmark a file to be opened with . + open all marked files. + + New option: |g:ctrlp_open_multi| + + Remove |g:ctrlp_persistent_input|, |g:ctrlp_live_update| and . + +Before 2011/09/29~ + + + New mappings: , next/prev string in the input history. + create a new file and its parent dirs. + + New options: |g:ctrlp_open_new_file|, + |g:ctrlp_max_history| + + Added a new open-in-horizontal-split mapping: + +Before 2011/09/19~ + + + New command: |ResetCtrlP| + + New options: |g:ctrlp_max_files|, + |g:ctrlp_max_depth|, + |g:ctrlp_live_update| + + New mapping: + +Before 2011/09/12~ + + + Ability to cycle through matched lines in the match window. + + Extend the behavior of |g:ctrlp_persistent_input| + + Extend the behavior of |:CtrlP| + + New options: |g:ctrlp_dotfiles|, + |g:ctrlp_clear_cache_on_exit|, + |g:ctrlp_highlight_match|, + |g:ctrlp_user_command| + + New special input: '..' (section 5.d) + + New mapping: . + + New commands: |:CtrlPCurWD|, + |:CtrlPCurFile|, + |:CtrlPRoot| + + + New feature: Search in most recently used (MRU) files + + New mapping: . + + Extended the behavior of . + + New options: |g:ctrlp_mru_files|, + |g:ctrlp_mruf_max|, + |g:ctrlp_mruf_exclude|, + |g:ctrlp_mruf_include| + + New command: |:CtrlPMRUFiles| + +First public release: 2011/09/06~ + +=============================================================================== +vim:ft=help:et:ts=2:sw=2:sts=2:norl diff -r 000000000000 -r 48859d9c82c5 vim/vimfiles/ftdetect/hut.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/vimfiles/ftdetect/hut.vim Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,1 @@ +au BufRead,BufNewFile *.hut set filetype=cpp diff -r 000000000000 -r 48859d9c82c5 vim/vimfiles/plugin/ctrlp.vim --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/vimfiles/plugin/ctrlp.vim Tue Jan 03 20:53:13 2012 -0600 @@ -0,0 +1,44 @@ +" ============================================================================= +" File: plugin/ctrlp.vim +" Description: Fuzzy file, buffer, mru and tag finder. +" Author: Kien Nguyen +" ============================================================================= +" GetLatestVimScripts: 3736 1 :AutoInstall: ctrlp.zip + +if ( exists('g:loaded_ctrlp') && g:loaded_ctrlp ) || v:version < 700 || &cp + fini +en +let [g:loaded_ctrlp, g:ctrlp_lines, g:ctrlp_allfiles] = [1, [], []] + +if !exists('g:ctrlp_map') | let g:ctrlp_map = '' | en + +com! -na=? -comp=custom,ctrlp#cpl CtrlP cal ctrlp#init(0, ) + +com! CtrlPBuffer cal ctrlp#init(1) +com! CtrlPMRUFiles cal ctrlp#init(2) + +com! ClearCtrlPCache cal ctrlp#clr() +com! ClearAllCtrlPCaches cal ctrlp#clra() +com! ResetCtrlP cal ctrlp#reset() + +com! CtrlPCurWD cal ctrlp#init(0, 0) +com! CtrlPCurFile cal ctrlp#init(0, 1) +com! CtrlPRoot cal ctrlp#init(0, 2) + +exe 'nn ' g:ctrlp_map ':CtrlP' + +cal ctrlp#mrufiles#init() + +if !exists('g:ctrlp_extensions') | fini | en + +if index(g:ctrlp_extensions, 'tag') >= 0 + let g:ctrlp_alltags = [] | com! CtrlPTag cal ctrlp#init(ctrlp#tag#id()) +en + +if index(g:ctrlp_extensions, 'quickfix') >= 0 + com! CtrlPQuickfix cal ctrlp#init(ctrlp#quickfix#id()) +en + +if index(g:ctrlp_extensions, 'dir') >= 0 + let g:ctrlp_alldirs = [] | com! CtrlPDir cal ctrlp#init(ctrlp#dir#id()) +en