Relative Line Numbers in Vim
jeffkreeftmeijer.com
jeffkreeftmeijer.com
And for those with the melpa repository set up, it can be found as the "linum-relative" package.
d3j (delete 3 down) and y3j (yank 3 down) do the same things, but relative. I don't even need to look at the relative numbers anymore really. For short hops I just guess. I'm right most of the times.
https://github.com/Lokaltog/vim-easymotion (there's an animated demonstration on the bottom of the readme)
Does anyone else have the same experience and perhaps a solution?
The last time I noticed this was with valgrind logs; and I have no idea what exactly is causing it (amount of lines doesn't seem to be it).
Thankfully it's perfectly usuable for day-to-day editing. Binding :set rn! to a key circumvents this problem well enough.
After some time I got used to it and I can select blocks of text of size 5-10 faster than I would using movement with number (I don't have to move my fingers away, I don't have to calculate or look at the relative distance). Advantage is that it works well outside of vim as well.
This sounds... strange to me. When would this be an advantage over some sort of named test? e.g. `manage.py test Thing.validation_test`
Never. "Line number" is very obscure and prone to breaking. "I just added a comment at the top of the file... Whoops! Broke all the tests."
To quote the Zen Of Python—"explicit is better than implicit".
The article is a bit old so I wonder if that is still a common Ruby practice (if it ever was).
The only time I've ever run specific tests by line-number is when I am working on making that single test green. In cases like that the line-number hardly ever changes (if it does, its because I've modified before filters or added a new `let`).
edit: for a bit more context: that entire string would not be typed in for the single test, it would be built from contexts.
describe User do
context "belongs to a valid and paid account" do
it "should allow creation of projects" do
end
end
endStep 2: Use the convenient 'cor' mapping for toggling 'relativenumber'
Step 3: Marvel at all the other super handy mappings contained within.
I see two slightly overlapping trends:
1. Alice is intrigued by all the fuss about Vim and tries her best to wrap her head around it by reading online material and "The Fucking Manual" and getting her hands dirty. Because she knows that she can't be as productive as with her previous editor in an afternoon, she learns Vim on the side. Another benefit of that method (and one she doesn't know about at the moment) is that her commitment can be very light at the beginning: when she'll finally decide that Vim is not for her she won't lost anything. If she likes it her commitment will grow with time, as well as her ROI.
2. Bob is a lot into Twitter, blogs, Reddit and HN and he noticed a serious slant of what he perceives as the elite toward Vim (and the screenshots are pretty) so he decides to follow the herd, however weird Vim might be He installs Janus/SPF13/YADR because he has to be a part of the elite right now, no time to setup all those plugins and stuff. After a couple of coderwall posts listing his favorite plugins, Bob will notice that the elite is moving toward Sublime Text, persuade himself and try to persuade others that Vim is too old and, finally, switch.
The two trends are slightly overlapping because a few Bobs are going to turn into Alices along the way. Thankfully, because who wants Bobs in his community?
For the record, I'm a Bob turned Alice.
Once you drink the cool-aid, there's nothing quite like it. Sometimes I think that scooting around a text file in vim is my favorite thing about coding.