Live data from Hacker News

Better line numbers for Vim

myusuf3.github.io

41–46 of 46 posts

Re: Better line numbers for Vim

#41
post #8

I was at one point very interested in the same idea. I wanted relative line numbers and absolute line numbers integrated together. So, I created a patch, called it `dnu` for "dual line numbering", and sent the suggestion to Bram Moolenaar. Here's what it looked like: http://i.imgur.com/NTwwB.jpg Here was the patch. I wrote it back in 2011: https://code.google.com/r/justinvh-vim/source/detail?r=c2479... Ultimately Bra…

I just wrote to the mailing list about that patch... it slows vim down so much, it makes the feature entirely unusable :( I wish the old way was back.

Re: Better line numbers for Vim

#42

In the video, the author moves a block of code by: 1. going to the start of the code block 2. changing mode to visual 3. moving to the end of the block 4. deleting the block 5. moving to the insertion point 6. inserting the delete buffer I'd like to suggest that using absolute line numbers shortens this considerably. For example :43,48m63 removes lines 43 to 48 and inserts them after line 63 regardless of the current…

You are technically correct, but coming up with those magic numbers(43, 48, 63) requires the user to manually try and find them, is more error-prone, and requires a whole lot more keypresses for larger blocks that don't fit on one screen.

I would argue that the author's way is the more idiomatic usage of vim.

Re: Better line numbers for Vim

#43
post #34

I got to know the numbers plugin from http://vim.spf13.com/ This distribution gets you a really good head start on vim and lets you install additional plugins easily with its VBundle Integration and its customization options. And in case if you ever wondered, why the ESC key is used to change to normal mode, you should read up on the history of the escape key. Therefore I use CTRL- to switch to normal mode, so my han…

No. SPF13 and the other so called "distributions" are the worst things a new vimmer could install. Starting with vanilla Vim is the only sane option if you are serious about it: learn the basics, get used to them and, if you don't like them, create your own mappings and/or look for plugins.

Be a Vim user, not an SPF13 user.

Also, you don't need to remap to as there's already or (the slightly different) .

And it's Vundle, not VBundle.

Re: Better line numbers for Vim

#44
post #37

Honestly, if you already use powerline or familiar extension, you can look at the status bar for the absolute line. I find it's no need for changing between modes. And if you use Mac OSX and latest vim version installed by homebrew, in relative line number mode of vim, instead of 0 it is the row line number.

You know you don't need Powerline to display information like line number in your statusline, right?

Re: Better line numbers for Vim

#45

In the video, the author moves a block of code by: 1. going to the start of the code block 2. changing mode to visual 3. moving to the end of the block 4. deleting the block 5. moving to the insertion point 6. inserting the delete buffer I'd like to suggest that using absolute line numbers shortens this considerably. For example :43,48m63 removes lines 43 to 48 and inserts them after line 63 regardless of the current…

Actually, he was in normal mode and issued

    5dd
at the start of the block.

Re: Better line numbers for Vim

#46
post #42

In the video, the author moves a block of code by: 1. going to the start of the code block 2. changing mode to visual 3. moving to the end of the block 4. deleting the block 5. moving to the insertion point 6. inserting the delete buffer I'd like to suggest that using absolute line numbers shortens this considerably. For example :43,48m63 removes lines 43 to 48 and inserts them after line 63 regardless of the current…

You are technically correct, but coming up with those magic numbers(43, 48, 63) requires the user to manually try and find them, is more error-prone, and requires a whole lot more keypresses for larger blocks that don't fit on one screen. I would argue that the author's way is the more idiomatic usage of vim.

idiomatic shmidiomatic, give me faster always!
Post reply on HN