J
Jeff Kreeftmeijer
jeffkreeftmeijer.com · Personal blog · on HN since 2010
Jeff Kreeftmeijer, a Ruby developer, writes about Git workflows, Vim settings, testing tools and Node.js.
What HN saysHN commenters link his posts on git-flow and Vim hybrid line numbers, and one finds the hybrid mode useful for relative and absolute numbers.
40HN people shared it
22linked it in comments
62stories submitted
1.7Kstory points
3 years agolast shared
2010people per year2026
Most-shared posts
- 1Why aren't you using git-flow?7 people · 215 points · first shared 2010 · 51 comments on HN
- 2Relative Line Numbers in Vim5 people · 65 points · first shared 2012 · 38 comments on HN
- 3Vim number5 people · first shared 2017
- 4Experimenting with Node.js4 people · 171 points · first shared 2010 · 83 comments on HN
- 5The magical -- and not harmful -- rebase (Git)3 people · 58 points · first shared 2010 · 24 comments on HN
- 6Fuubar: the instafailing RSpec progress bar formatter3 people · 34 points · first shared 2010 · 2 comments on HN
- 7Steak: because Cucumber is for vegetarians3 people · 34 points · first shared 2010 · 26 comments on HN
- 8Vim's new hybrid line number mode3 people · 6 points · first shared 2013 · 1 comments on HN
- 9Consistent terminal colors with 16-ANSI-color Vim themes3 people · 5 points · first shared 2018 · discussion on HN
- 10Finally a way to mark your Github project as abandoned2 people · 22 points · first shared 2010 · 4 comments on HN
- 11MicroGems: five minute RubyGems with Gists2 people · 19 points · first shared 2011 · 2 comments on HN
- 12The mighty reflog and the amazing bisect2 people · 15 points · first shared 2010 · 1 comments on HN
- 13Stop releasing prototypes2 people · 6 points · first shared 2011 · discussion on HN
- 14Acceptance testing using Capybara's new RSpec DSL2 people · 3 points · first shared 2011 · discussion on HN
- 15Vim is hard, I just want to click around1 people · 178 points · first shared 2011 · 91 comments on HN
What HN people wrote when they linked it
laszlokorte · 2016-07-13
It's definitely my favorite git client! It looks great and provides a very nice macOS like experience and and gives access to all git features I need. Especially I like the interface for single-line-staging and managing submodules. I use it everyday.
It's not and IDE as you do not edit your code inside Tower but just use it for staging/committing/push/pull.
It also has support for git-flow [1] but I am not using that.
[1]: http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/
telemachos · 2012-02-07
I've tried relative numbers a few times in Vim, but always found it hard to adjust. But recently Jeff Kreeftmeijer wrote up a way to get the best of both worlds[1]: relative numbers in command mode and absolute numbers in insert mode or if Vim loses focus. Just another option to consider.
[1] http://jeffkreeftmeijer.com/2012/relative-line-numbers-in-vim-for-supe…
steveklabnik · 2010-12-03
Then the follow up: http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/
and the code:
https://github.com/nvie/gitflow
cookiestack · 2010-11-23
Hey David,
I really like what you have done, a nice twist on the ol' like button. And its a pretty cool looking site as well.
One thing does, well, concern me a bit, and its that you haven't given credit where credit is due (http://jeffkreeftmeijer.com/2010/experimenting-with-node-js/).
There is no doubt that this is very similar to Jeffs blog post, and although it takes the idea a step further, I do think you should at least add a link to any and all code which inspired you and which you took ideas from, if it be Jeffs previous post, or a Node Knockout project.
Best of luck with getting Valves attention, and you have my pointers vote :)
rendall · 2022-03-15
> What's the best way to rapidly move around without having to count lines?
oooh. I have a treat for you! Check out "hybrid line numbers". I thought they would be weird when I heard about them, but they're awesome, and I never need "absolute line numbers". But the linked article shows you how to set up toggling if you need them.
Basically, they look like this:
3 Lorem ipsum dolor sit amet,
2 nunc in iaculis ipsum.
1 Suspendisse dapibus odio erat,
98 non varius nulla porttitor at. // <-- You are here
1 Nullam in convallis elit.
2 Sed nec venenatis ligula.
3 consectetur adipiscing elit.
4 Sed hendrerit ac ante sed viverra.
In this example, your cursor is at line 98 and so shows the absolute line number. The other lines are relative to your current line. If you want to go down to the line that starts consectetur, you see that it is below you 3 lines. You have to type 3j. If you need to find a specific line number, say 24, type :24
Here's an article on them: https://jeffkreeftmeijer.com/vim-number/
metachris · 2011-02-11
No matter how often you want to review code, I think it could work for your team like this:
- dev works on a feature branch, making multiple commits and pushes
- once ready, squash all the commits and submit it to gerrit
[- perhaps have hudson/jenkins run the unit tests at this point automatically]
- have the code review in gerrit
- once the review is done, gerrit would merge it into the develop or master branch (depending on your git workflow)
That approach blends in nicely with git-flow (1). If you want to be sure that no single dev is pushing to the develop or master branches you'd need to setup per-branch permissions, which can be done with gitolite (2). Too bad github (even the self-hosted version) doesn't support per-branch permissions, which forces organizations that use it and only want gerrit to be able to push into the main branch to do excessive repo forking instead of using feature branches. Also I'd love to be able to do ad-hoc code reviews in github, as the interface is the most beautiful of all imo.
[1] http://nvie.com/posts/a-successful-git-branching-model/, https://github.com/nvie/gitflow, http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/
[2] https://github.com/sitaramc/gitolite
WALoeIII · 2010-10-27
50,000 ft overview:
Rspec: Behavior Driven Development Framework. It is essentially a different approach to testing than the test/unit (which Rails uses by default). In Rspec you are more interested in testing the side effects of your code, i.e. its behavior, you are less concerned with the internals. This doesn't mean you should write huge methods, and in the end your specs and tests will look pretty similar. My company uses Rspec on our main project.
http://gist.github.com/649417
People will argue the value of the different styles until they're blue in the face. I liked Rspec's syntax more so thats where I started, but in the end I know both and think they each have their own merits and its probably a total wash. Recently with things like shoulda and other tools both approaches are rapidly converging on the same feature set.
Cucumber: Integration framework. This tests your whole stack end-to-end. Depending on what you are building this may be the only way to test it, and for a lot of people they are just doing Unit + Integration tests and not writing any controller tests. You write in Gherkin (http://github.com/aslakhellesoy/cucumber/wiki/gherkin) which is a special subset of English. You can also use Steak (http://jeffkreeftmeijer.com/2010/steak-because-cucumber-is-for-vegetar… which lets you write your story in pure Ruby. Either way, this story is broken out in to steps and then some driver follows those steps, either driving or emulating a web browser. The…
bumbledraven · 2024-04-29
> The page gives "5k 12j" as an example, there's no way in the world it's faster for me to figure out that "12" is the right number faster than through other means.
If you add `set relativenumber` to your .vimrc, then the nth line up and the nth line down from from your current line will each have an n on the left-hand side. This lets you see at a glance which motion (e.g., `5k` or `12j`) will take you to a given line.
https://jeffkreeftmeijer.com/vim-number/
mrzool · 2022-04-02
I achieve that same consistency with virtually zero configuration by simply setting the colors in my terminal and forgetting about it. Stopped all the fiddling with color schemes quite a while ago.
Good explanation: https://jeffkreeftmeijer.com/vim-16-color/
vulcan01 · 2021-05-26
Instead of counting, you can use :set relativenumber (vim/neovim builtin) to quickly see how far away lines are.
(see https://jeffkreeftmeijer.com/vim-number/)
alwillis · 2017-10-23
It also sounds like you don't have relative line numbers enabled, which makes highlighting or jumping some number of lines quickly pretty trivial: https://jeffkreeftmeijer.com/vim-number/
A Vim truism: if what you're doing requires too many keystrokes or otherwise seems cumbersome, there's another way to do it that faster and requires fewer keystrokes.
It's just a matter of whether you're interested in learning and not assuming you have it all figured out.
solutionyogi · 2015-06-19
True. You do have to fix all the true conflicts. But you have to do it only once. If you merge your master, you have to resolve conflicts every time you merge from the master. git rerere could be potentially useful here.
Even more importantly rebase allows you to resolve conflict at individual commit level. During conflict, you can see the exact commit that is causing it, making it much easier to resolve it.
See: http://jeffkreeftmeijer.com/2010/the-magical-and-not-harmful-rebase/
AlexSolution · 2014-01-29
I prefer hybrid line numbering. This way, you can see the true number of the line you are on, while all the other lines on the screen are numbered relative to your position.
http://jeffkreeftmeijer.com/2013/vims-new-hybrid-line-number-mode/
barbs · 2013-07-14
A nice simple solution. Thanks!
Here's something a little more complicated, which may or may not be more useful:
http://jeffkreeftmeijer.com/2012/relative-line-numbers-in-vim-for-supe…
cheald · 2012-12-17
You might be interested in git-flow[1] which is a formalization of this workflow.
[1] http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/
JonnieCache · 2012-10-04
SkyMarshal · 2010-11-30
It works similarly if you're using the gitflow extension:
https://github.com/nvie/gitflow
http://jeffkreeftmeijer.com/2010/why-arent-you-using-git-flow/
Or doing that manually. Git is pretty flexible.
jkreeftmeijer · 2010-11-23
This is a really nice implementation, but here's how I did it a couple of months ago (with an explanation on how to do it yourself): http://jeffkreeftmeijer.com/2010/experimenting-with-node-js ;)
flacon · 2010-11-23
Seems like this has been done before: http://jeffkreeftmeijer.com/2010/experimenting-with-node-js/
Using Node.js. The node js example even provides the code to replicate it. Is this person using node or some other websocket approach?
swombat · 2010-09-06
You can also use Steak:
http://jeffkreeftmeijer.com/2010/steak-because-cucumber-is-for-vegetar…
frognibble · 2010-08-06
It's interesting to compare this example with the somewhat similar example written with node.js: http://jeffkreeftmeijer.com/2010/experimenting-with-node-js/
laughinghan · 2019-12-18
> vi in Unix highlights the amount of time you spend watching the screen as you cursor around with hjkl
vi is four decades old. It's not the pinnacle of keyboard-driven interface design, vast improvements have been made since then.
For example, I use vim-sneak, which lets you jump to anywhere on your screen in 3 keystrokes flat 99% of the time (and the 1% of the time where you miss, well, 99% of those times, just one more keystroke is all it takes to get to the right spot): https://github.com/justinmk/vim-sneak
I also use relative line numbers, so I can select or delete most blocks of text in 3 or 4 keystrokes, for example d4j deletes the current line and the next 4 lines (5 lines total), or d23k deletes the current line and the previous 23 lines (24 lines total): https://jeffkreeftmeijer.com/vim-number/
Obviously number of keystrokes isn't the only factor that determines operation speed. This is actually exemplified by my second example, commands like "d23k" actually work out-of-the-box even in original vi, the problem is that counting 23 lines by eye is way slower than selecting 24 lines with a mouse by eye, which is solved by relative line numbers.