Is it possible to have a line number for the erlang source code?

Used by emacs and erlang code for printing. Since the author modifying the source in git sourcetree shows me the line number. If the line number is being printed, it is much better to quickly find it by the line number. But how do you set it up?


source to share

4 answers

You can use number number mode , but you can even use goto-line to jump directly to the line number:

`M-g M-g'
`M-g g'
     Read a number N and move point to the beginning of line number N
     (`goto-line').  Line 1 is the beginning of the buffer.  If point
     is on or just after a number in the buffer, that is the default
     for N.  Just type <RET> in the minibuffer to use it. 




If you want visual line numbers (like in Eclipse, for example) you can take a look linum-mode

(this is part of Emacs since 23). To enable linum globally, just add this line to yours .emacs

(or equivalent):

(global-linum-mode +1)




You can use a2ps

to create a printout. It takes parameters -C

(put a line number on every fifth line) and --line-number=NUM

(put a line number on every NUM line). For example:

a2ps -o -C foo.erl




You can use highlight .

It supports both line numbering and Erlang syntax highlighting.



All Articles