Word count in Kate?

Attention lazyweb! Okay, I typically use Vim for all my text editing needs, but one of my co-workers is using (or was using) Kate and couldn’t find a word count feature. I popped Kate open on my desktop (version 2.5.0, from Ubuntu/Kubuntu) and couldn’t find a word count either — granted, I didn’t look too hard, but I’m thinking word count should be pretty much a given in any text editor/word processor, right?

Does anyone know if Kate has this functionality buried somewhere deep inside its twisty menu maze? Bonus points if someone could point me to a plugin or something that enables vi-like keybindings in Kate — I happen to like some of its features, but I just can’t get into writing or editing in anything that isn’t modal. It’s sick, I know.

By the way — word count in Vim is pretty easy: Just select the text you want to count, and use g Ctrl-g while in command mode. This will tell you how many words, lines, and columns you have selected as well as the number of words, lines, and columns in the file itself. Alternately, you can use :wc! % if you prefer the wc utility.

About Joe Brockmeier

I'm a freelance writer, FOSS advocate, music lover, computer geek, avid reader, and politically progressive (read "Liberal with occasional Libertarian tendencies"). You can read more on my about page if you're not already bored.
This entry was posted in Linux, Open Source, Writing. Bookmark the permalink.

4 Responses to Word count in Kate?

  1. Catcher80 says:

    I found a solution for Kate’s wordcount at: http://www.ubuntuforums.org/archive/index.php/t-92218.html

    Key binding like Vim? man oh man, good luck :-)

  2. Zonker says:

    Yeah, I had found the link you point to… unfortunately, I don’t think that’s really suitable in this case. I was hoping that Kate actually had wordcount, and it was just buried in some weird place. It’s disheartening to think that it doesn’t have something as simple as wordcount. :/ I’m not terribly shocked that it doesn’t have Vim keybindings.

  3. In KDE 4.0 you will be able to do this easier, but for KDE 3.5 you can use the External Tools menu. See the last mail in http://www.nabble.com/Kate-external-tools-to3751576.html

  4. Murz says:

    On kate with kde 4.x you can add the script:
    1. Go to Settings – Configure kate
    2. In “plugins” enable “External tools”
    3. Go to “External tools” tab
    4. Click “New”
    5. Post thouse stings:

    Label: Selection stat

    Script: msg=`echo -E “%selection” | wc -cmwl | sed ‘s/\s*\([0-9]*\)\s*\([0-9]*\)\s*\([0-9]*\)\s*\([0-9]*\)/Bytes: \4\nCharacters: \3\nWords: \2\nLines: \1/’` && kdialog –msgbox “$msg”

    Executable: kdialog

    Command line name: selection_stat

    6. Restart kate.

    After this you can found it at Tools – External tools – Selection stat

    It counts bytes, chars, words and lines of selected text.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>