[erlang-questions] Erlang Mode Mavens: customizations?
Wed May 14 13:33:33 CEST 2008
On Wed, May 14, 2008 at 9:56 AM, Jachym Holecek <>
> + tabbar mode.
+ erlware-mode (http://code.google.com/p/erlware-mode/)
My personal favourites are (add to your init.el/custom.el etc):
(defun duplicate-one-line ()
"Duplicate the current line. There is a little bug: when current line is
the last line of the buffer, this will not work as expected. Anyway, that's
ok for me."
(let ((start (progn (beginning-of-line) (point)))
(end (progn (next-line 1) (beginning-of-line) (point))))
(insert-buffer-substring (current-buffer) start end)
(global-set-key (kbd "C-=") 'duplicate-one-line)
(defun move-one-line-downward ()
"Move current line downward once."
(global-set-key (kbd "C-down") 'move-one-line-downward)
(defun move-one-line-upward ()
"Move current line upward once."
(global-set-key (kbd "C-up") 'move-one-line-upward)
(defvar previous-column nil "Save the column position")
(defun nuke-line ()
"Kill current line and restore column position."
(setq previous-column (current-column))
(global-set-key [(shift delete)] 'nuke-line)
This makes Ctrl+= duplicate the current line, very handy! Ctrl+Up switches
the current and the line above and Ctrl+Down switches the current and the
line below enabling you to move a line up and down in the buffer. Also
handy! Lastly Shift+Delete is bound to kill the whole line and saving the
Taken from: http://exceedhl.wordpress.com/2006/07/13/tweak-emacs/
This one makes Shift+Backspace delete all whitespace around the cursor:
(global-set-key (kbd "S-BS") 'delete-horizontal-space)
The perfect challenge for a cunning elisp-developer would be to enhance the
move one line upward and downward functions to take care of Erlang's line
ending characters, i.e. so that commas, semicolons and periods aren't moved
together with the line.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions