word count

9 views
Skip to first unread message

Igor Lerinc

unread,
Dec 28, 2022, 11:26:01 AM12/28/22
to vim_use
we have relative numbering for lines, so we don't have to calculate when we want to jump between lines.

But is something similar possible for words? 
For current line to show, what number of word it is? Depending on where cursor is?

Because i don't feel like calculating how much words there is between cursor and word where i want to jump to. And it would be faster and efficient, 'to just know' how much words to jump in current line to get to some word


Steve Litt

unread,
Dec 28, 2022, 11:56:14 AM12/28/22
to vim...@googlegroups.com
Igor Lerinc said on Wed, 28 Dec 2022 08:26:01 -0800 (PST)
6w in display mode jumps you 6 words ahead.


SteveT

Steve Litt
Autumn 2022 featured book: Thriving in Tough Times
http://www.troubleshooters.com/bookstore/thrive.htm

Igor Lerinc

unread,
Dec 28, 2022, 12:19:15 PM12/28/22
to vim...@googlegroups.com
Yes, but is there way for it, to show some sort of numbers relative to curson on that line. 
Some small nukber above word, idk. 
Just not to calculate how much words i need to jump, if i want to go jumping between words.


--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

---
You received this message because you are subscribed to a topic in the Google Groups "vim_use" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/vim_use/hDg2QmgCGtc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to vim_use+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/vim_use/20221228115601.00354fed%40mydesk.domain.cxm.

Enan Ajmain

unread,
Dec 28, 2022, 12:37:13 PM12/28/22
to vim...@googlegroups.com
On Wed, 28 Dec 2022 08:26:01 -0800 (PST)
Should be easy, specially if Vim has a way to add virtual text. But I
think that'd add too much noise to be useful.

I suggest using 'f' and 't' and plain searching ('/' and '?') to move
around than motions like 'nw', 'nb', 'ne', etc. (where 'n' is any
positive integer). I can't provide any statistical data supporting that
'f','t','/','?' are better, but try it out and see if it works before
investing time building a custom plugin to add “relative numbering for
words.”

P.S. I don't use line numbers (relative or otherwise) either, except
when doing pair programming. I find that '/','?' are much faster and
precise and jumping to lines with 'nj','nk','nG', etc. So consider my
suggestion with enough skepticism.

--
Enan
3nan....@gmail.com
https://git.sr.ht/~enan/
https://www.github.com/3N4N

Milan Glacier

unread,
Dec 28, 2022, 12:58:57 PM12/28/22
to vim...@googlegroups.com
Don't you know there are vim-easymotion, vim-sneak, and many other
plugins for quick navigation? If you want pluginless, I don't come up
with an easy way to do so in a script with only a few lines.
Reply all
Reply to author
Forward
0 new messages