Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

vim and character counting

2 views
Skip to first unread message

Lou Lesko

unread,
Jun 25, 2002, 1:02:39 PM6/25/02
to
Any way to have a vim display a character count in the status bar? My
best friend is deaf and uses a mobile messageing device that can handle
160 chracters at a time. When I type emails to her I'm not quite sure
if I've run on too long.

Thanks
lou

Grog

unread,
Jun 25, 2002, 1:48:18 PM6/25/02
to

All I can think of is saving the file once in a while, which shows you
how many lines & characters are written. For example, this message
shows me 21L, 792C.

--
#* \|||/ Anything is good if it's made of chocolate.
thks -(o o)-
/--ooO-(_)-Ooo--\
(remove 'NOSPAM' to email me)

Ralf Wildenhues

unread,
Jun 25, 2002, 4:27:36 PM6/25/02
to

:set statusline=%{line2byte(line(\"$\")+1)-1}
:set laststatus=2

HTH&HAND
Ralf

Ralf Wildenhues

unread,
Jun 25, 2002, 5:03:53 PM6/25/02
to

:set statusline=%{line2byte(line(\"$\")+1)-1}
:set laststatus=2

*time passes*

Hmm, unfortunately vim does not update the status line too often.
Anybody have an idea to make it update? Maybe even in insert mode?

HTH&HAND
Ralf

Thomas Dickey

unread,
Jun 25, 2002, 4:50:53 PM6/25/02
to

> *time passes*

( vile can ;-)

--
Thomas E. Dickey <dic...@radix.net> <dic...@herndon4.his.com>
http://dickey.his.com
ftp://dickey.his.com

Peppe

unread,
Jun 25, 2002, 4:25:18 PM6/25/02
to
Thus wrote Ralf Wildenhues <ralfimn...@gmx.de>

> *time passes*

It worked fine for me until I tried it in an empty buffer.

After a bit of testing I can never make it work for the last line in a
buffer. However, if I specify a syntax group (even one that will never
be in effect), it works everywhere else in the buffer (even in insert
mode).

Try the following in a file (tmp.vimrc)

se ls=2 stl=%{line2byte(line(\"$\")+1)-1}
syn keyword Foo foo contained

And invoke vim with 'compatible' on and off (either will work):

$ vim -u tmp.vimrc
$ vim -u tmp.vimrc -N

Looks buggy to me; I'll take it up on vim-dev.

Peppe
--
"Before you criticize someone, walk
Preben "Peppe" Guldberg __/-\__ a mile in his shoes. That way, if
c92...@student.dtu.dk (o o) he gets angry, he'll be a mile away
----------------------oOOo (_) oOOo-- - and barefoot." --Sarah Jackson

Steuer Josef

unread,
Jun 26, 2002, 4:34:15 AM6/26/02
to
Lou Lesko wrote:

Try
g Ctrl-g

I hope this is the needed information

regards

Josef

Lou Lesko

unread,
Jun 26, 2002, 1:17:32 PM6/26/02
to
this isn't exactly what I was looking for but it will certainly do
thanks for your response

thanks to everyone else as well

louis

* Steuer Josef <parz...@gmx.de>:

0 new messages