Added VimtexCountLetters
Also changed name: VimtexWordCount to VimtexCountWords
This commit is contained in:
parent
e70c0b469c
commit
6e9dae11a4
@ -109,10 +109,11 @@ function! vimtex#info(global) " {{{1
|
||||
endfunction
|
||||
|
||||
" }}}1
|
||||
function! vimtex#wc(detailed) " {{{1
|
||||
function! vimtex#wc(detailed, ...) " {{{1
|
||||
" Run texcount, save output to lines variable
|
||||
let cmd = 'cd ' . vimtex#util#shellescape(b:vimtex.root)
|
||||
let cmd .= '; texcount -nosub -sum '
|
||||
let cmd .= a:0 > 0 ? '-letter ' : ''
|
||||
let cmd .= a:detailed > 0 ? '-inc ' : '-merge '
|
||||
let cmd .= vimtex#util#shellescape(b:vimtex.base)
|
||||
let lines = split(system(cmd), '\n')
|
||||
@ -308,10 +309,11 @@ function! s:init_buffer() " {{{1
|
||||
"
|
||||
|
||||
" Define commands
|
||||
command! -buffer -bang VimtexInfo call vimtex#info(<q-bang> == "!")
|
||||
command! -buffer -bang VimtexWordCount call vimtex#wc(<q-bang> == "!")
|
||||
command! -buffer VimtexReload call vimtex#reload()
|
||||
command! -buffer VimtexToggleMain call vimtex#toggle_main()
|
||||
command! -buffer -bang VimtexInfo call vimtex#info(<q-bang> == "!")
|
||||
command! -buffer -bang VimtexCountWords call vimtex#wc(<q-bang> == "!")
|
||||
command! -buffer -bang VimtexCountLetters call vimtex#wc(<q-bang> == "!", 1)
|
||||
command! -buffer VimtexReload call vimtex#reload()
|
||||
command! -buffer VimtexToggleMain call vimtex#toggle_main()
|
||||
|
||||
" Define mappings
|
||||
nnoremap <buffer> <plug>(vimtex-info) :VimtexInfo<cr>
|
||||
|
@ -1085,19 +1085,22 @@ Commands~
|
||||
:VimtexReload Reload |vimtex| scripts. This is primarely useful
|
||||
when developing and debugging |vimtex| itself.
|
||||
|
||||
*VimtexWordCount*
|
||||
:VimtexWordCount Shows the number of words in the current project.
|
||||
The count is created with `texcount` through a call
|
||||
on the main project file similar to: >
|
||||
*VimtexCountLetters*
|
||||
*VimtexCountWords*
|
||||
:VimtexCountLetters Shows the number of letters/characters or words in
|
||||
:VimtexCountWords the current project. The count is created with
|
||||
`texcount` through a call on the main project file
|
||||
similar to: >
|
||||
|
||||
texcount -nosub -sub -merge FILE
|
||||
texcount -nosub -sub [-letter] -merge FILE
|
||||
<
|
||||
*VimtexWordCount!*
|
||||
:VimtexWordCount! Similar to |VimtexWordCount|, but show separate
|
||||
reports for included files. I.e. presents the
|
||||
result of >
|
||||
*VimtexCountLetters!*
|
||||
*VimtexCountWords!*
|
||||
:VimtexCountLetters! Similar to |VimtexCountLetters|/|VimtexCountWords|, but
|
||||
:VimtexCountWords! show separate reports for included files. I.e.
|
||||
presents the result of >
|
||||
|
||||
texcount -nosub -sub -inc FILE
|
||||
texcount -nosub -sub [-letter] -inc FILE
|
||||
<
|
||||
*VimtexImapsList*
|
||||
*<plug>(vimtex-imaps-list)*
|
||||
|
Loading…
x
Reference in New Issue
Block a user