-
-
Notifications
You must be signed in to change notification settings - Fork 316
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to put word count on lightline? #295
Comments
I googled for let g:lightline = {
\ 'active': {
\ 'right': [ [ 'lineinfo' ], [ 'percent', 'wordcount' ], [ 'fileformat', 'fileencoding', 'filetype' ] ]
\ },
\ 'component_function': {
\ 'wordcount': 'WordCount',
\ },
\ } |
Hi, I tried your solution but it doesn't work - nothing is shown in the statusline... Do I have to enable/do something else to make this work? Calling the WordCount function directly does work, though. Thanks a lot! |
@andreas-bulling It works for me. Please paste your configuration or link to your vimrc. |
Worked like a charm! |
The above script (in the link) works well, but if you are on newer versions of vim/neovim you can now use the following script to get selected words count and words 'so far'. "new in vim 7.4.1042
let g:word_count=wordcount().words
function WordCount()
if has_key(wordcount(),'visual_words')
let g:word_count=wordcount().visual_words."/".wordcount().words " count selected words
else
let g:word_count=wordcount().cursor_words."/".wordcount().words " or shows words 'so far'
endif
return g:word_count
endfunction |
No description provided.
The text was updated successfully, but these errors were encountered: