In Emacs, how do I display the current line or column, or move to a specific line or column?
Note: The Emacs keystroke designations differ from the ones used in the rest of the Knowledge Base. For clarifications, see In Emacs, how are keystrokes denoted?
These commands are useful for moving to and/or displaying lines and columns:
|Go to a specific line:||
|Display the current line:||
|Count the lines on the current page and display the current line*:||
|Display line number in the mode line:||
|Display column number in the mode line**:||
*In Emacs, a page is defined as the space between
C-l characters. Emacs will return the wrong value if you
enter this command at the beginning of a line.
**Requires Emacs 20 or higher. Emacs 21 is available on all UITS central systems at Indiana University.
To enable line-number-mode by default in Emacs, enter the following
(setq line-number-mode t)
Likewise, if you are using Emacs 20 or higher, you can also enable
column-number-mode by default by entering into your
(setq column-number-mode t)
For more information, see the Emacs FAQ.
At Indiana University, for personal or departmental Linux or Unix systems support, see At IU, how do I get support for Linux or Unix?
Last modified on October 27, 2010.