6 ms·
Numbers.vim - A vim plugin for better line numbers
- spicyj 14y agoAlready posted a couple of months ago: http://news.ycombinator.com/item?id=4172099 http://news.ycombinator.com/item?id=4172099
- lucisferre 14y agoLately it feels like the HN front page is stuck in a loop.
- nvmc 14y agoI heard the same thing happened to another link aggregator.
- Derbasti 14y agoWhy is it better? And better than what?
- city41 14y agoI believe the general theory is relative line numbering helps you when in normal mode. If you want to manipulate a chunk of lines, sometimes you revert to counting them then doing something like <n>yy. With relative line numbering the counting is effectively done for you. But to me, I try to avoid counting arbitrary lines and instead try and do something like y/<unique marker> or ya{ or whatever.
- JamesLeonis 14y agoThere 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.
- gbin 14y agoThis is awesome. I just made an ebuild for it : https://plus.google.com/110857536631648345380/posts/4NeGmXfMVHg https://plus.google.com/110857536631648345380/posts/4NeGmXfM...
- saurabh 14y agoCan anybody tell me what relative numbers are useful for other than navigation? I find Easymotion the state-of-the-art plugin for navigation.
- ollysb 14y agoYeah, 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 14y agoAnyone have a screenshot of how this looks?
- rpearl 14y agoUsing a plugin for this seems... unnecessary.
- yureka 14y agoYou can obtain similar functionality by adding the following to your .vimrc: https://gist.github.com/3012145 https://gist.github.com/3012145
- digitaltoad 14y agoYou 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 14y agod5j delete five from where you are- inclusive
- digitaltoad 14y agoThis still means you would be counting 5 lines whereas I'm just specifying what line to delete to.
- dhimes 14y agoI am subtracting, but your point is valid.
- noeleon 14y agowhy not just use visual mode?? then you can see the lines you are deleting, copying / cutting
- newman314 14y agoDoes 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.