Thanks, Allan. Now to put my money where my mouth is and buy a license.
Stuart
On Nov 16, 2004, at 4:03 PM, Stuart Wheeler wrote:
Now all I need to do is work out how to determine the number of characters and words I am highlighting (without manually counting them). Is it possible to do that in TextMate at the moment? If I can find that out then I'll buy a license.
You can create a command (menu: Command / Edit Commands…).
Set the Command(s): to “wc”, Standard input to “Selected text” and Standard output to “Show as tooltip”.
If you bind a key to this command, you get the “lines words characters” shown for selected text as a tooltip when you press the key -- it's not as convenient as having the information in the status bar all the time, but I hope it'll make do until I add it.
OK, got my license. Thanks!
I hadn't even looked at the command stuff that closely - reminds me a little of TextPad on Windows. This opens up a whole new world of usefulness. I changed your command to:
wc | /usr/bin/awk '{print "lines:", $1, " words:", $2, " chars:", $3}'
That seems to explain the numbers a little better.
Stuart
On 16 Nov 2004, at 16:11, Stuart Wheeler wrote:
Thanks, Allan. Now to put my money where my mouth is and buy a license.
Stuart
On Nov 16, 2004, at 4:03 PM, Stuart Wheeler wrote:
Now all I need to do is work out how to determine the number of characters and words I am highlighting (without manually counting them). Is it possible to do that in TextMate at the moment? If I can find that out then I'll buy a license.
You can create a command (menu: Command / Edit Commands…).
Set the Command(s): to “wc”, Standard input to “Selected text” and Standard output to “Show as tooltip”.
If you bind a key to this command, you get the “lines words characters” shown for selected text as a tooltip when you press the key -- it's not as convenient as having the information in the status bar all the time, but I hope it'll make do until I add it.
Does that work with double-byte or "special" characters ? Last time I tried the character count wasn't accurate for UTF-8 encoded characters or punctuation. Thanks.
On Tue, 16 Nov 2004 16:31:39 +0000, Stuart Wheeler textmatelist.to.wheeles@spamgourmet.com wrote:
OK, got my license. Thanks!
I hadn't even looked at the command stuff that closely - reminds me a little of TextPad on Windows. This opens up a whole new world of usefulness. I changed your command to:
wc | /usr/bin/awk '{print "lines:", $1, " words:", $2, " chars:", $3}'
On Nov 17, 2004, at 10:39 PM, Ned Baldessin wrote:
Does that work with double-byte or "special" characters ? Last time I tried the character count wasn't accurate for UTF-8 encoded characters or punctuation. Thanks.
Ah, that's true. You could pipe the text through e.g.: “iconv -f utf-8 -t iso-8859-1//TRANSLIT” then the character count should be correct.
On 17.11.2004, at 23:47, Allan Odgaard wrote:
Ah, that's true. You could pipe the text through e.g.: “iconv -f utf-8 -t iso-8859-1//TRANSLIT” then the character count should be correct.
Works fine with that command. Just remember that the character count includes the spaces, which might or might not be what you want.
Cheers, Jarkko
-- Jarkko Laine http://jlaine.net