Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

In your vimrc add the following (version 7.3+):

    set number
    set relativenumber
This turns your line numbers into a hybrid mode that show the numbers relative to your cursor and the actual line number your cursor is currently on.


Yikes! The continually changing numbers drives me crazy. Thanks for the tip, but I think I'll stick with just using ":13" to go to line #13... I guess there is some benefit if you do a lot of yanking/cutting based on lines, rather than some magic matching or such. But for now, relative line numbers is not for me.

For (a little) more, see:

http://vim.wikia.com/wiki/Jump_to_a_line_number


This doesn't work for me in 7.3.429-2ubuntu2.1. It still shows 0 for the line you're currently on.


That is way cooler than my old 'focus' hack. Thank you!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: