Ryan Rueger

ryan@rueg.re / picture / key / home
aboutsummaryrefslogtreecommitdiff
path: root/plugin/statusryne.vim
diff options
context:
space:
mode:
authorrrueger <rrueger@ethz.ch>2024-06-05 15:08:54 +0200
committerrrueger <rrueger@ethz.ch>2024-06-05 15:08:54 +0200
commitcac4489fb51348ae828564389ddbf621693997e9 (patch)
tree2e3668a7bb6930e27e4e733116776119b45ad9db /plugin/statusryne.vim
parent4f09b6804112bad5fa3e3fd8c35a583c449d231b (diff)
downloadstatusryne-cac4489fb51348ae828564389ddbf621693997e9.tar.gz
statusryne-cac4489fb51348ae828564389ddbf621693997e9.tar.bz2
statusryne-cac4489fb51348ae828564389ddbf621693997e9.zip
Add g:statusryne_word_char_count option
Decides whether/character count statistics are shown
Diffstat (limited to 'plugin/statusryne.vim')
-rw-r--r--plugin/statusryne.vim26
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 ''