mirror of
https://github.com/vim-airline/vim-airline-themes.git
synced 2024-12-05 08:30:03 +08:00
Add format to the wordcount plugin
This commit is contained in:
parent
14d14cf951
commit
1c498d1af3
|
@ -2,6 +2,7 @@
|
|||
" 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()
|
||||
|
@ -21,7 +22,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
|
||||
|
|
Loading…
Reference in New Issue
Block a user