Skip to content

Commit

Permalink
Updated vim plugins
Browse files Browse the repository at this point in the history
  • Loading branch information
amix committed Nov 9, 2016
1 parent aad9560 commit 1494e2e
Show file tree
Hide file tree
Showing 81 changed files with 2,755 additions and 469 deletions.
40 changes: 29 additions & 11 deletions sources_non_forked/ctrlp.vim/autoload/ctrlp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ let [s:pref, s:bpref, s:opts, s:new_opts, s:lc_opts] =
\ 'bufname_mod': ['s:bufname_mod', ':t'],
\ 'bufpath_mod': ['s:bufpath_mod', ':~:.:h'],
\ 'formatline_func': ['s:flfunc', 's:formatline(v:val)'],
\ 'user_command_async': ['s:usrcmdasync', 0],
\ }, {
\ 'open_multiple_files': 's:opmul',
\ 'regexp': 's:regexp',
Expand Down Expand Up @@ -212,11 +213,13 @@ el
en
let g:ctrlp_builtins = len(g:ctrlp_types)-1

let s:coretypes = filter([
\ ['files', 'fil'],
\ ['buffers', 'buf'],
\ ['mru files', 'mru'],
\ ], 'index(g:ctrlp_types, v:val[1])!=-1')
let s:coretype_names = {
\ 'fil' : 'files',
\ 'buf' : 'buffers',
\ 'mru' : 'mru files',
\ }

let s:coretypes = map(copy(g:ctrlp_types), '[s:coretype_names[v:val], v:val]')

" Get the options {{{2
fu! s:opts(...)
Expand Down Expand Up @@ -326,11 +329,11 @@ fu! s:Open()
cal s:setupblank()
endf

fu! s:Close(exit)
fu! s:Close()
cal s:buffunc(0)
if winnr('$') == 1
bw!
elsei a:exit
el
try | bun!
cat | clo! | endt
cal s:unmarksigns()
Expand Down Expand Up @@ -431,6 +434,11 @@ fu! s:GlobPath(dirs, depth)
en
endf

fu! ctrlp#addfile(ch, file)
call add(g:ctrlp_allfiles, a:file)
cal s:BuildPrompt(1)
endf

fu! s:UserCmd(lscmd)
let [path, lscmd] = [s:dyncwd, a:lscmd]
let do_ign =
Expand All @@ -446,7 +454,13 @@ fu! s:UserCmd(lscmd)
if (has('win32') || has('win64')) && match(&shell, 'sh') != -1
let path = tr(path, '\', '/')
en
if has('patch-7.4-597') && !(has('win32') || has('win64'))
if s:usrcmdasync && v:version >= 800 && exists('*job_start')
if exists('s:job')
call job_stop(s:job)
en
let g:ctrlp_allfiles = []
let s:job = job_start([&shell, &shellcmdflag, printf(lscmd, path)], {'callback': 'ctrlp#addfile'})
elsei has('patch-7.4-597') && !(has('win32') || has('win64'))
let g:ctrlp_allfiles = systemlist(printf(lscmd, path))
el
let g:ctrlp_allfiles = split(system(printf(lscmd, path)), "\n")
Expand Down Expand Up @@ -658,7 +672,7 @@ fu! s:Update(str)
let pat = s:matcher == {} ? s:SplitPattern(str) : str
let lines = s:nolim == 1 && empty(str) ? copy(g:ctrlp_lines)
\ : s:MatchedItems(g:ctrlp_lines, pat, s:mw_res)
if empty(str) | call clearmatches() | en
if empty(str) | cal clearmatches() | en
cal s:Render(lines, pat)
return lines
endf
Expand Down Expand Up @@ -923,7 +937,7 @@ fu! s:PrtExit()
let bw = bufwinnr('%')
exe bufwinnr(s:bufnr).'winc w'
if bufnr('%') == s:bufnr && bufname('%') == 'ControlP'
noa cal s:Close(1)
noa cal s:Close()
noa winc p
els
exe bw.'winc w'
Expand Down Expand Up @@ -2562,6 +2576,10 @@ fu! ctrlp#init(type, ...)
cal s:SetWD(a:0 ? a:1 : {})
cal s:MapNorms()
cal s:MapSpecs()
if empty(g:ctrlp_types) && empty(g:ctrlp_ext_vars)
call ctrlp#exit()
retu
en
if type(a:type) == 0
let type = a:type
el
Expand All @@ -2588,7 +2606,7 @@ if has('autocmd')
aug CtrlPAug
au!
au BufEnter ControlP cal s:checkbuf()
au BufLeave ControlP noa cal s:Close(0)
au BufLeave ControlP noa cal s:Close()
au VimLeavePre * cal s:leavepre()
aug END
en
Expand Down
3 changes: 2 additions & 1 deletion sources_non_forked/ctrlp.vim/doc/ctrlp.cnx
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,8 @@ MRU mode options:~
在匹配窗口和提示符面板之间切换焦点。

<esc>,
<c-c>
<c-c>,
<c-g>
退出CtrlP。

移动:~
Expand Down
3 changes: 2 additions & 1 deletion sources_non_forked/ctrlp.vim/doc/ctrlp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -943,7 +943,8 @@ Once inside the prompt:~
Toggle the focus between the match window and the prompt.

<esc>,
<c-c>
<c-c>,
<c-g>
Exit CtrlP.

Moving:~
Expand Down
2 changes: 1 addition & 1 deletion sources_non_forked/ctrlp.vim/plugin/ctrlp.vim
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ let [g:ctrlp_lines, g:ctrlp_allfiles, g:ctrlp_alltags, g:ctrlp_alldirs,
if !exists('g:ctrlp_map') | let g:ctrlp_map = '<c-p>' | en
if !exists('g:ctrlp_cmd') | let g:ctrlp_cmd = 'CtrlP' | en

com! -n=? -com=dir CtrlP cal ctrlp#init('fil', { 'dir': <q-args> })
com! -n=? -com=dir CtrlP cal ctrlp#init(0, { 'dir': <q-args> })
com! -n=? -com=dir CtrlPMRUFiles cal ctrlp#init('mru', { 'dir': <q-args> })

com! -bar CtrlPBuffer cal ctrlp#init('buf')
Expand Down
104 changes: 52 additions & 52 deletions sources_non_forked/lightline.vim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -415,15 +415,15 @@ let g:lightline = {
\ [ 'fugitive', 'readonly', 'filename', 'modified' ] ]
\ },
\ 'component_function': {
\ 'fugitive': 'LightLineFugitive',
\ 'readonly': 'LightLineReadonly',
\ 'modified': 'LightLineModified'
\ 'fugitive': 'LightlineFugitive',
\ 'readonly': 'LightlineReadonly',
\ 'modified': 'LightlineModified'
\ },
\ 'separator': { 'left': '⮀', 'right': '⮂' },
\ 'subseparator': { 'left': '⮁', 'right': '⮃' }
\ }
function! LightLineModified()
function! LightlineModified()
if &filetype == "help"
return ""
elseif &modified
Expand All @@ -435,7 +435,7 @@ function! LightLineModified()
endif
endfunction
function! LightLineReadonly()
function! LightlineReadonly()
if &filetype == "help"
return ""
elseif &readonly
Expand All @@ -445,7 +445,7 @@ function! LightLineReadonly()
endif
endfunction
function! LightLineFugitive()
function! LightlineFugitive()
return exists('*fugitive#head') ? fugitive#head() : ''
endfunction
```
Expand All @@ -464,16 +464,16 @@ let g:lightline = {
\ [ 'fugitive', 'filename' ] ]
\ },
\ 'component_function': {
\ 'fugitive': 'LightLineFugitive',
\ 'readonly': 'LightLineReadonly',
\ 'modified': 'LightLineModified',
\ 'filename': 'LightLineFilename'
\ 'fugitive': 'LightlineFugitive',
\ 'readonly': 'LightlineReadonly',
\ 'modified': 'LightlineModified',
\ 'filename': 'LightlineFilename'
\ },
\ 'separator': { 'left': '⮀', 'right': '⮂' },
\ 'subseparator': { 'left': '⮁', 'right': '⮃' }
\ }
function! LightLineModified()
function! LightlineModified()
if &filetype == "help"
return ""
elseif &modified
Expand All @@ -485,7 +485,7 @@ function! LightLineModified()
endif
endfunction
function! LightLineReadonly()
function! LightlineReadonly()
if &filetype == "help"
return ""
elseif &readonly
Expand All @@ -495,21 +495,21 @@ function! LightLineReadonly()
endif
endfunction
function! LightLineFugitive()
function! LightlineFugitive()
return exists('*fugitive#head') ? fugitive#head() : ''
endfunction
function! LightLineFilename()
return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
function! LightlineFilename()
return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
\ ('' != expand('%:t') ? expand('%:t') : '[No Name]') .
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
endfunction
```
![lightline.vim - tutorial](https://raw.githubusercontent.com/wiki/itchyny/lightline.vim/image/tutorial/14.png)

Oops! We forgot the cool mark for the branch component! (work with the patched font for vim-powerline)
```vim
function! LightLineFugitive()
function! LightlineFugitive()
if exists("*fugitive#head")
let branch = fugitive#head()
return branch !=# '' ? '⭠ '.branch : ''
Expand All @@ -528,7 +528,7 @@ let g:lightline = {
\ 'left': [ [ 'mode', 'paste' ],
\ [ 'my_component' ] ] },
\ 'component_function': {
\ 'my_component': 'LightLineComponent', ...
\ 'my_component': 'LightlineComponent', ...
```

This is the end of the tutorial. For more information, see `:help lightline`. Good luck with your nice statuslines.
Expand All @@ -555,57 +555,57 @@ let g:lightline = {
\ 'left': [ [ 'mode', 'paste' ], [ 'fugitive', 'filename' ] ]
\ },
\ 'component_function': {
\ 'modified': 'LightLineModified',
\ 'readonly': 'LightLineReadonly',
\ 'fugitive': 'LightLineFugitive',
\ 'filename': 'LightLineFilename',
\ 'fileformat': 'LightLineFileformat',
\ 'filetype': 'LightLineFiletype',
\ 'fileencoding': 'LightLineFileencoding',
\ 'mode': 'LightLineMode',
\ 'modified': 'LightlineModified',
\ 'readonly': 'LightlineReadonly',
\ 'fugitive': 'LightlineFugitive',
\ 'filename': 'LightlineFilename',
\ 'fileformat': 'LightlineFileformat',
\ 'filetype': 'LightlineFiletype',
\ 'fileencoding': 'LightlineFileencoding',
\ 'mode': 'LightlineMode',
\ },
\ 'separator': { 'left': '⮀', 'right': '⮂' },
\ 'subseparator': { 'left': '⮁', 'right': '⮃' }
\ }
function! LightLineModified()
function! LightlineModified()
return &ft =~ 'help\|vimfiler\|gundo' ? '' : &modified ? '+' : &modifiable ? '' : '-'
endfunction
function! LightLineReadonly()
function! LightlineReadonly()
return &ft !~? 'help\|vimfiler\|gundo' && &readonly ? '⭤' : ''
endfunction
function! LightLineFilename()
return ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
function! LightlineFilename()
return ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
\ (&ft == 'vimfiler' ? vimfiler#get_status_string() :
\ &ft == 'unite' ? unite#get_status_string() :
\ &ft == 'vimshell' ? vimshell#get_status_string() :
\ '' != expand('%:t') ? expand('%:t') : '[No Name]') .
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
endfunction
function! LightLineFugitive()
function! LightlineFugitive()
if &ft !~? 'vimfiler\|gundo' && exists("*fugitive#head")
let branch = fugitive#head()
return branch !=# '' ? '⭠ '.branch : ''
endif
return ''
endfunction
function! LightLineFileformat()
function! LightlineFileformat()
return winwidth(0) > 70 ? &fileformat : ''
endfunction
function! LightLineFiletype()
function! LightlineFiletype()
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
endfunction
function! LightLineFileencoding()
function! LightlineFileencoding()
return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
endfunction
function! LightLineMode()
function! LightlineMode()
return winwidth(0) > 60 ? lightline#mode() : ''
endfunction
```
Expand Down Expand Up @@ -640,12 +640,12 @@ let g:lightline = {
\ 'right': [ [ 'syntastic', 'lineinfo' ], ['percent'], [ 'fileformat', 'fileencoding', 'filetype' ] ]
\ },
\ 'component_function': {
\ 'fugitive': 'LightLineFugitive',
\ 'filename': 'LightLineFilename',
\ 'fileformat': 'LightLineFileformat',
\ 'filetype': 'LightLineFiletype',
\ 'fileencoding': 'LightLineFileencoding',
\ 'mode': 'LightLineMode',
\ 'fugitive': 'LightlineFugitive',
\ 'filename': 'LightlineFilename',
\ 'fileformat': 'LightlineFileformat',
\ 'filetype': 'LightlineFiletype',
\ 'fileencoding': 'LightlineFileencoding',
\ 'mode': 'LightlineMode',
\ 'ctrlpmark': 'CtrlPMark',
\ },
\ 'component_expand': {
Expand All @@ -657,28 +657,28 @@ let g:lightline = {
\ 'subseparator': { 'left': '|', 'right': '|' }
\ }
function! LightLineModified()
function! LightlineModified()
return &ft =~ 'help' ? '' : &modified ? '+' : &modifiable ? '' : '-'
endfunction
function! LightLineReadonly()
function! LightlineReadonly()
return &ft !~? 'help' && &readonly ? 'RO' : ''
endfunction
function! LightLineFilename()
function! LightlineFilename()
let fname = expand('%:t')
return fname == 'ControlP' && has_key(g:lightline, 'ctrlp_item') ? g:lightline.ctrlp_item :
\ fname == '__Tagbar__' ? g:lightline.fname :
\ fname =~ '__Gundo\|NERD_tree' ? '' :
\ &ft == 'vimfiler' ? vimfiler#get_status_string() :
\ &ft == 'unite' ? unite#get_status_string() :
\ &ft == 'vimshell' ? vimshell#get_status_string() :
\ ('' != LightLineReadonly() ? LightLineReadonly() . ' ' : '') .
\ ('' != LightlineReadonly() ? LightlineReadonly() . ' ' : '') .
\ ('' != fname ? fname : '[No Name]') .
\ ('' != LightLineModified() ? ' ' . LightLineModified() : '')
\ ('' != LightlineModified() ? ' ' . LightlineModified() : '')
endfunction
function! LightLineFugitive()
function! LightlineFugitive()
try
if expand('%:t') !~? 'Tagbar\|Gundo\|NERD' && &ft !~? 'vimfiler' && exists('*fugitive#head')
let mark = '' " edit here for cool mark
Expand All @@ -690,19 +690,19 @@ function! LightLineFugitive()
return ''
endfunction
function! LightLineFileformat()
function! LightlineFileformat()
return winwidth(0) > 70 ? &fileformat : ''
endfunction
function! LightLineFiletype()
function! LightlineFiletype()
return winwidth(0) > 70 ? (&filetype !=# '' ? &filetype : 'no ft') : ''
endfunction
function! LightLineFileencoding()
function! LightlineFileencoding()
return winwidth(0) > 70 ? (&fenc !=# '' ? &fenc : &enc) : ''
endfunction
function! LightLineMode()
function! LightlineMode()
let fname = expand('%:t')
return fname == '__Tagbar__' ? 'Tagbar' :
\ fname == 'ControlP' ? 'CtrlP' :
Expand Down
Loading

0 comments on commit 1494e2e

Please sign in to comment.