4 ms·
I’ve found relative line numbering to be distracting, and I find myself wanting absolute line numbering far more often. The reason that people want relative lin
by chrismorgan 12y ago
I’ve found relative line numbering to be distracting, and I find myself wanting absolute line numbering far more often. The reason that people want relative line numbering is almost always for relative motions, e.g. `6j`. But I find that this is seldom actually all that useful; there are various alternatives; here are a few:
- `}` to go forward by paragraph.
- `zj` to go down to the next fold.
- `gg` and `G` both accept a count (with which they are identical), so that `50gg` means “go to line 50”, and so absolute line numbers suffice though the command will typically be a little longer; of course, unlike `6j`, this will go to the start of the line if 'startofline' is not unset, so it’s not always ideal, but I find myself rather good at knowing at sight how many lines down and up I need to go anyway.
- isbadawi 12y agoYou can use a hybrid of absolute and relative numbering by setting both the 'number' and 'relativenumber' options (in vim 7.4). It displays the absolute number of the current line (instead of 0) but relative numbers of the other lines.
- sondr3 12y agoCare to give any links to this? This is probably my biggest annoyance with Vim right now, how my current line is 0 and having to add 1 every time I do any operation gets old quick.
- deleted 12y ago[deleted]
- userbinator 12y agoI use :<line-number><enter> to go to a specific line; it has the advantage of showing the digits of the line number as it's entered.
- palmer_eldritch 12y agoIf you set the 'showcmd' option, the command you're currently typing is displayed on the last line of the screen (same as command line) on the right. Of course, saving one keypress on this isn't a big deal but it's nice sometimes to be able to see the command you're typing.
- realyze 12y agoFair enough. I kinda switch between those two. Like, when I need to yank 5 lines from the middle of a function, I find it quite comfortable to see the relative numbers.
- kristiandupont 12y agoAt work I use VsVim and this plugin https://visualstudiogallery.msdn.microsoft.com/74d68e2b-ff64-4c51-a2ed-d8b164eee858 https://visualstudiogallery.msdn.microsoft.com/74d68e2b-ff64... allows both simultaneously, which suits me best. I have not been able to achieve that in vim yet though.
- johnmaguire2013 12y agoOr just `:<number>`?