1
0
mirror of https://github.com/amix/vimrc synced 2025-06-16 01:25:00 +08:00

Updated plugins and added vim-jade

This commit is contained in:
amix
2016-01-05 15:18:45 -03:00
parent 3aabd8befd
commit 795a8fb80d
35 changed files with 1036 additions and 131 deletions

View File

@ -14,6 +14,10 @@ if s:head_format == 1
function! s:format_name(name)
return fnamemodify(a:name, ':t')
endfunction
elseif s:head_format == 2
function! s:format_name(name)
return pathshorten(a:name)
endfunction
elseif type(s:head_format) == type('')
function! s:format_name(name)
return call(s:head_format, [a:name])

View File

@ -2,12 +2,16 @@
" vim: et ts=2 sts=2 sw=2
let s:filetypes = get(g:, 'airline#extensions#wordcount#filetypes', '\vhelp|markdown|rst|org')
let s:format = get(g:, 'airline#extensions#wordcount#format', '%d words')
" adapted from http://stackoverflow.com/questions/114431/fast-word-count-function-in-vim
function! s:update()
if &ft !~ s:filetypes
unlet! b:airline_wordcount
return
elseif mode() =~? 's'
" Bail on select mode
return
endif
let old_status = v:statusmsg
@ -21,7 +25,7 @@ function! s:update()
if len(parts) > 11
let cnt = str2nr(split(stat)[11])
let spc = g:airline_symbols.space
let b:airline_wordcount = cnt . spc . 'words' . spc . g:airline_right_alt_sep . spc
let b:airline_wordcount = printf(s:format, cnt) . spc . g:airline_right_alt_sep . spc
else
unlet! b:airline_wordcount
endif