M-x all-things-emacs

Quick Tip: Line Numbering

March 29th, 2007 by Rob Christie · 43 Comments

linum I frequent the gnu.emacs.sources news group as one route to finding out about new packages. linenum.el came across the list recently. The package displays line numbers on the left side of your buffer. The author indicates that it is an alternative to setnu.el with the benefit that it works incrementally and can handle large files. It seems like one of those packages that is nice to have in your bag of tricks. Of course, you may just want the current line number in your modeline by using the M-x line-number-mode command. You can set it by default with the following line in your .emacs file.

(line-number-mode 1)

And in case you forgot (or didn’t know), M-g M-g (or M-g g) is the key binding for M-x goto-line in Emacs 22.

Tags: quick · tips

43 responses so far ↓

  • 1 Rob Christie // Mar 29, 2007 at 2:45 pm

    One of my officemates just pointed out to me that the goto-line key binding is only in Emacs 22. I will update the post. Thanks Andy.

  • 2 Bryan // Mar 29, 2007 at 10:12 pm

    Good tip! I didn’t know about the Emacs 22 keybinding. That’s pretty handy.

    If you just want to know what line you are on occasionally you can ask, M-x what-line.

  • 3 Free Mind » Blog Archive » linum.el: Yet another package for Emacs to display line number // Aug 29, 2007 at 3:39 pm

    [...] setnu.el(??? setnu+.el) ?? wb-line-number.el ???????????? linum.el [...]

  • 4 michigan health saginaw covenant care // Jan 8, 2009 at 10:49 am

    saginaw health mi covenant care saginaw michigan health covenant care

  • 5 chenlevy's status on Thursday, 18-Jun-09 12:56:08 UTC - Identi.ca // Jun 18, 2009 at 12:56 pm

    [...] http://www.emacsblog.org/2007/03/29/quick-tip-line-numbering/ is for #emacs what ``:set number`` is for [...]

  • 6 line numbering in emacs (as in vi) // Jun 8, 2011 at 7:08 pm

    [...] the department.) In vi you just use :set nu – the is a site that explains that this is possible http://emacsblog.org/2007/03/29/quic…ine-numbering/ It describes a linenum.el – and I can see the program, but don't understand how to install [...]

  • 7 giulio // May 31, 2013 at 1:16 pm

    Maybe I’m using wrong linenum.el, but line numbers appear as a part of the buffer to me, so that typing return doesn’t add a new line with a new number , but instead put my cursor between two line numbers.
    There’s a way to change this behaviour a gedit-like one? There numbers line are automatically refreshed by typing and cannot by modified or navigated with cursor keys, backspace and del.
    Any idea?

  • 8 Personal Trainer Seattle // Jul 22, 2015 at 12:37 am

    ... [Trackback]

    [...] Read More Infos here: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 9 online con cret creatine // Jul 23, 2015 at 4:20 pm

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 10 amazin gas station video // Jul 24, 2015 at 9:00 am

    ... [Trackback]

    [...] Read More Infos here: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 11 drinking and driving // Jul 24, 2015 at 9:27 pm

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 12 criminal defense attorney // Jul 24, 2015 at 11:19 pm

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 13 limo rental atlanta // Jul 25, 2015 at 1:48 pm

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 14 Citrus Heights Locksmith // Jul 26, 2015 at 6:22 am

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 15 locksmith Fair Oaks ca // Jul 26, 2015 at 6:27 am

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 16 Marsna Design Search Engine Optimization // Jul 27, 2015 at 3:00 pm

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 17 CRS Locksmith Folsom // Jul 28, 2015 at 10:09 pm

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 18 Insider Binary Bot Review // Jul 31, 2015 at 3:48 pm

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 19 Prodaja staklene ambalaze // Aug 1, 2015 at 2:36 am

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 20 fjc security // Aug 1, 2015 at 4:12 pm

    ... [Trackback]

    [...] There you will find 40386 more Infos: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 21 window repair // Aug 2, 2015 at 7:28 pm

    ... [Trackback]

    [...] There you will find 64430 more Infos: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 22 What colors are available in Amarr steel garage doors? // Aug 2, 2015 at 8:21 pm

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 23 weblink // Aug 2, 2015 at 11:30 pm

    ... [Trackback]

    [...] There you will find 71042 more Infos: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 24 www.tiptopplumbers.com // Aug 2, 2015 at 11:42 pm

    ... [Trackback]

    [...] Find More Informations here: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 25 home page // Aug 3, 2015 at 1:46 pm

    ... [Trackback]

    [...] There you will find 28812 more Infos: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 26 ventolin prescription prices // Aug 3, 2015 at 5:12 pm

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 27 Why is it important to choose a reliable company? // Aug 4, 2015 at 1:03 am

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 28 glass block install // Aug 4, 2015 at 1:25 am

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 29 complete bathroom renovation // Aug 4, 2015 at 3:46 am

    ... [Trackback]

    [...] Read More Infos here: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 30 wire electric outlet // Aug 4, 2015 at 7:09 am

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 31 skillfullcontracting.com // Aug 5, 2015 at 7:13 am

    ... [Trackback]

    [...] There you will find 56649 more Infos: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 32 pool repair // Aug 5, 2015 at 7:20 am

    ... [Trackback]

    [...] Find More Informations here: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 33 foto bugil // Aug 7, 2015 at 8:35 am

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 34 butchering azoblack atheous // Aug 8, 2015 at 8:59 am

    initially slow, its steady and effective for

    quality blog traffic. comment on other blogs and provide a link to a relevant post of yours that is on-topic. this is a great but under-utilized way of diverting prospective blog readers to your blog provided you have posted a topic

  • 35 here are the findings // Aug 9, 2015 at 6:24 pm

    ... [Trackback]

    [...] Read More here: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 36 important site // Aug 9, 2015 at 6:47 pm

    ... [Trackback]

    [...] There you will find 74796 more Infos: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 37 click for more info // Aug 10, 2015 at 10:16 pm

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 38 social checker // Aug 12, 2015 at 10:15 pm

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 39 anonymous // Aug 13, 2015 at 12:15 am

    ... [Trackback]

    [...] There you will find 76720 more Infos: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 40 trending topics // Aug 13, 2015 at 12:23 am

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 41 electrical upgrades // Aug 13, 2015 at 11:43 pm

    ... [Trackback]

    [...] Informations on that Topic: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 42 How do I unjam my garbage disposal? // Aug 14, 2015 at 12:01 am

    ... [Trackback]

    [...] Read More: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]

  • 43 http://optimumdentist.com // Aug 14, 2015 at 12:19 am

    ... [Trackback]

    [...] There you will find 32448 more Infos: emacsblog.org/2007/03/29/quick-tip-line-numbering/ [...]