diff options
author | rrueger <rrueger@ethz.ch> | 2024-06-05 15:08:54 +0200 |
---|---|---|
committer | rrueger <rrueger@ethz.ch> | 2024-06-05 15:08:54 +0200 |
commit | cac4489fb51348ae828564389ddbf621693997e9 (patch) | |
tree | 2e3668a7bb6930e27e4e733116776119b45ad9db | |
parent | 4f09b6804112bad5fa3e3fd8c35a583c449d231b (diff) | |
download | statusryne-cac4489fb51348ae828564389ddbf621693997e9.tar.gz statusryne-cac4489fb51348ae828564389ddbf621693997e9.tar.bz2 statusryne-cac4489fb51348ae828564389ddbf621693997e9.zip |
Add g:statusryne_word_char_count option
Decides whether/character count statistics are shown
-rw-r--r-- | plugin/statusryne.vim | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/plugin/statusryne.vim b/plugin/statusryne.vim index f5a28fe..4b48024 100644 --- a/plugin/statusryne.vim +++ b/plugin/statusryne.vim @@ -135,19 +135,23 @@ function! FileStats() let bytes = bytes / 1000 endfor - " Word count - let old_status = v:statusmsg - exe ":silent normal g\<c-g>" - if v:statusmsg == '--No lines in buffer--' - let word_count = '0(w)' - let char_count = '0(c)' + if exists("g:statusryne_word_char_count") && g:statusryne_word_char_count == "0" + return size else - let word_count = str2nr(split(v:statusmsg)[11]) . '(w)' - let char_count = str2nr(split(v:statusmsg)[15]) . '(c)' - endif - let v:statusmsg = old_status + " Word count + let old_status = v:statusmsg + exe ":silent normal g\<c-g>" + if v:statusmsg == '--No lines in buffer--' + let word_count = '0(w)' + let char_count = '0(c)' + else + let word_count = str2nr(split(v:statusmsg)[11]) . '(w)' + let char_count = str2nr(split(v:statusmsg)[15]) . '(c)' + endif + let v:statusmsg = old_status - return word_count . ' ' . char_count . ' ' . size + return word_count . ' ' . char_count . ' ' . size + endif else return '' |