The Emacs goto-line Command

As I’ve written before, I came to Emacs after years as a Vi/Vim user. One of the things I was used to doing in Vim was to go to line N in a file by typing :N in command mode. I learned Emacs mostly by referring to the Emacs Reference Card that’s included with the distribution and, unfortunately, the reference card does not mention any way of jumping to a particular line. Over time I evolved some dopey way of doing it, probably 【Meta+< Ctrl+N Ctrl+n】 or something equally horrible.

Eventually, I discovered the answer hidden away in the Edit→Go To menu. The official way is 【Meta+g g】 to bring up the Go To Line: prompt in the minibuffer but 【Meta+g Meta+g】 also works and is easier to type. Mac OS X users can use 【⌘ Cmd+l】 if they prefer.

None of this is earth shattering and perhaps I’m the only Emacs user who didn’t know it but I am writing it down in case someone else out there is also wondering how to do it.

This entry was posted in General and tagged . Bookmark the permalink.