AnthonyDiGirolamo / airline-themes

vim-airline themes https://github.com/vim-airline/vim-airline-themes for emacs powerline https://github.com/milkypostman/powerline
MIT License
123 stars 20 forks source link

How to add visually selected line count??? #12

Open windrg opened 9 years ago

windrg commented 9 years ago

Hi, First of all, thanks for your this great contribution. But I really wonder how to add a number which indicates how many lines are currently visually selected. (Of course, now I'm using evil mode and in Vim, it shows the number on the command line, not the power line.) Could you give me an idea or a guideline how to figure out to do so, please?

AnthonyDiGirolamo commented 8 years ago

You can edit the format of the modeline by changing the airline-themes-set-modeline function. I tried to document it thoroughly. Line 321 in airline-themes.el (https://github.com/AnthonyDiGirolamo/airline-themes/blob/master/airline-themes.el#L321) is where the current line is shown.

You could try changing "-LINE" on line 189 in airline-themes.el (https://github.com/AnthonyDiGirolamo/airline-themes/blob/master/airline-themes.el#L189) to (format "-LINE %d" (count-lines (region-beginning) (region-end))) That mostly works for me but gives inconsistent counts depending on if the cursor is on the beginning of the line or in the middle.