May 11, 2006

Emacs tips #2 : linenumbers

Posted in Emacs at 11:25 by theBlackDragon

A question that pops up pretty often is how you can add line numbers in the margin of your files the way most other editors do.

There are actually two ways of doing this:

  • adding the numbers in the margin
  • adding the numbers to your files, so that they get saved with your file, might be useful in certain cases (COBOL source?)

Unfortunately Emacs doesn't support either out of the box, but fortunately people have written modes that do exactly this. Modes for both the former as the latter can be found on the EmacsWiki.

Personally I (occasionaly) use setnu.el which works extremely well for my purposes.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s