Hacker News new | ask | show | jobs
by qwertyuiop924 3539 days ago
Of course we do: You can jump by searching for line contents with C-s, you can do an operation a certain number of times with M-<number> <operation>, and do an operation four times with C-u <operation>, which chains, so you can do an operation 16 times with C-u C-u <operation>.

If you want to jump to a specific line number, you can use M-g M-g <number>, or (because C-u also provides numerical arguments) C-u <number> M-g M-g.

Finally, many motion commands set the mark, so you can use C-x C-x to return to where you were and select all text between your previous and current locations.

Oh, and if you want something even better, you can use C-` to jump to the location of compiler error if you use M-x compile, you can use ag.el or helm-ag for ag integration, Ace-Jump, which is similar to EasyMotion, built-in exuberant ctags integration (and a built-in ctags clone, etags), packages for cscope integration (if you're using C), and fiinally semantic, which provides a variety of parser-based tooling if it's supported by your language.

But you can also just use C-n, etc. and we won't judge you for it.

2 comments

> "But you can also just use C-n, etc. and we won't judge you for it."

This is probably the biggest selling point of the Emacs community. They're not going to try to guilt or shame you into using more efficient or more advanced commands. If C-n works for you, use it!

Of course. We can't judge you. Your configuration and setup is likely so different that unless we meet up in person, it's impossible to tell who is more efficient.
Wait, how’s this different from Vim? You can use :<number> to go to a line and C-o to return to where you were.
It's really not different, except that we have more, better options for how to go about it. The difference is, you can just use C-n, and nobody will complain that you're doing it wrong. Well, not too much, anyways.
Sounds like the options are the same. Note that it isn’t some kind of Vim standard that j shouldn’t be used repeatedly, just this author’s opinion. I do it all the time.
Does vim have the ability to jump to compiler errors, ctags integration, cscope integration, and integration with sourcecode parser based tooling?