5 ms·
I'm still pondering the "how is this useful?" part... why are absolute numbers useful for you in insert mode?
by joshcorbin 14y ago
I'm still pondering the "how is this useful?" part... why are absolute numbers useful for you in insert mode?
- solutionyogi 14y agoMy exact thought. I absolutely love 'relative line numbering' as it lets me use different VIM commands without having to do math. And as I can go to any line number by typing ':<line number>' [generally reported by debugger or other means], I don't really care about actual line numbers anymore.
- brown9-2 14y agoIn addition, if you have 'set ruler' set, the absolute line number of the current line is displayed at the bottom of the screen when in insert mode.
- pwf 14y agoI still feel like I have to do math (albeit simple math) with relative line numbering. If I want to yank a block of code that's X lines long, I have to look at line X, and add one to the number next to it. E.g., when I want to grab 8 lines, the last line I want to grab has a 7 next to it. I guess I think it'd be more helpful if the numbers were inclusive, and 1-indexed. I'm not sure how to configure that though.
- solutionyogi 14y agoYes, I wish the numbering was 1-indexed. But by now, I have trained my brain to automatically add one. I would definitely prefer a fix where I don't have to do +1.
- googletron 14y agowell when you moving around code you want to be in normal mode. so lets say you cursor is at the top of the function which would be 0 (with relative numbering) you could simply look down and see how many lines you need to delete. so for example lets say 5, then you could simply do 5dd or 5yy, without having to count all to see how many lines which can get annoying. while in insert mode you would simply want to see what line you are one and for collaboration with others. In cases where you might want jump to a line like :15. There is also a NumberToggle function if you ever need to switch on the go.
- dionidium 14y agoIf you're operating on more than just a couple lines, then it's probably a bad sign to be doing math. It's usually better to navigate to the end of the selection and set a mark or select the text in visual mode.
- alinajaf 14y agoI've found it occasionally useful when pairing, i.e. "no no, I mean the call on line 23, not 28".