Lightline.vim: Is it possible to put word count on lightline?

Created on 17 Mar 2018  路  4Comments  路  Source: itchyny/lightline.vim

configuration

Most helpful comment

I googled for word count vim and found a script https://gist.github.com/cormacrelf/d0bee254f5630b0e93c3. Example configuration using this function:

let g:lightline = {
      \ 'active': {
      \   'right': [ [ 'lineinfo' ], [ 'percent', 'wordcount' ], [ 'fileformat', 'fileencoding', 'filetype' ] ]
      \ },
      \ 'component_function': {
      \   'wordcount': 'WordCount',
      \ },
      \ }

All 4 comments

I googled for word count vim and found a script https://gist.github.com/cormacrelf/d0bee254f5630b0e93c3. Example configuration using this function:

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!
If you are having trouble with a separate file, just put the function directly into .vimrc

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dongsibo picture dongsibo  路  4Comments

kiryph picture kiryph  路  3Comments

indiesquidge picture indiesquidge  路  4Comments

Char-Aznable picture Char-Aznable  路  4Comments

rotsix picture rotsix  路  4Comments