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

set relativenumber

I had been using Vim for years, and this is fundamentally one of the most useful settings I came across. I think it's only available it the latest rel.

Funny side note, I was out on the town one night and saw a bunch of guys and girls hacking on their laptops... in a club. I noticed one guy using Vim, came up behind him and told him he has a good taste in editors. It turns out he's Jay Freeman (saurik). I showed him relativenumber and he was stoked. EOS.



Thanks a lot! For a vimrc also supporting other version than 7.3:

  if version >= 730
    set relativenumber
  endif


I ran across some variation on this toggle somewhere. Very handy.

  " toggle line numbers from absolute to relative with f2.
  map <silent> <F2> :if &number <Bar>
      \set relativenumber <Bar>
        \else <Bar>
      \set number <Bar>
        \endif<cr>


If you ever run into him again, buy him a beer please for Cydia.


(stares in wonder)


I love Jay, seems like a great overall guy.


Thank you for making me aware of this.




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

Search: