

Numbers.vim - A vim plugin for better line numbers - rdegges
https://github.com/myusuf3/numbers.vim

======
spicyj
Already posted a couple of months ago:
<http://news.ycombinator.com/item?id=4172099>

~~~
lucisferre
Lately it feels like the HN front page is stuck in a loop.

~~~
nvmc
I heard the same thing happened to another link aggregator.

------
rpearl
Using a plugin for this seems... unnecessary.

~~~
yureka
You can obtain similar functionality by adding the following to your .vimrc:
<https://gist.github.com/3012145>

------
digitaltoad
You shouldn't ever have to count lines in vim. The five line deletion example
could have been done as:

    
    
      10dG
    

Which would delete from the cursor to the tenth line.

~~~
dhimes
d5j

delete five from where you are- inclusive

~~~
digitaltoad
This still means you would be counting 5 lines whereas I'm just specifying
what line to delete to.

~~~
dhimes
I am subtracting, but your point is valid.

------
Derbasti
Why is it better? And better than what?

~~~
JamesLeonis
There are two types of line numbering in vim, relative and absolute. The
former counts the lines starting from the vertical position of the cursor,
backwards and forwards. The latter starts at the top of the file to the bottom
of the file.

Vim has several ways to move and edit a file. For example, to go to a specific
line, you would use <n>gg and you would jump to that line. This is useful for
navigation as well as selection.

There are likewise commands that are relative from the cursor's position. dd
and yy come immediately to mind, as well as the h-j-k-l commands. Knowing how
many lines you need is augmented from the relative line numbering.

The key here is Vim doesn't have an easy way to switch from one to the other,
except through manually typing commands like `set relativenumber` and `set
number`. The plugin switches the number count based on what mode you are in.

------
newman314
Does this make it so that highlighting in Terminal (prior to copying) only
selects the text?

I had line numbers set till it turned out that when I selected a bunch of text
for copying selected the line numbers too. Ugh.

------
gbin
This is awesome. I just made an ebuild for it :
[https://plus.google.com/110857536631648345380/posts/4NeGmXfM...](https://plus.google.com/110857536631648345380/posts/4NeGmXfMVHg)

------
saurabh
Can anybody tell me what relative numbers are useful for other than
navigation? I find Easymotion the state-of-the-art plugin for navigation.

~~~
ollysb
Yeah, easymotion does make counting words/lines seem rather redundant. I'm
just hoping that they'll extend easymotion so I don't even need to think about
what I'm jumping to i.e. I hit leader leader and every non-white character is
indexed to jump to.

------
gm
Anyone have a screenshot of how this looks?

~~~
reledi
The HN submission would be better as this page:
<http://myusuf3.github.com/numbers.vim>

~~~
gm
Awesome, even better. Thanks!

------
noeleon
why not just use visual mode?? then you can see the lines you are deleting,
copying / cutting

