On Wed, May 14, 2008 at 9:56 AM, Jachym Holecek <<a href="mailto:jachym.holecek@e-fractal.cz">jachym.holecek@e-fractal.cz</a>> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
+ tabbar mode.<font color="#888888"><br></font></blockquote></div><br>+ erlware-mode (<a href="http://code.google.com/p/erlware-mode/">http://code.google.com/p/erlware-mode/</a>)<br><br>My personal favourites are (add to your init.el/custom.el etc):<br>
<br><span style="font-family: courier new,monospace;">(defun duplicate-one-line ()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "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."</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> (interactive)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> (let ((start (progn (beginning-of-line) (point)))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> (end (progn (next-line 1) (beginning-of-line) (point))))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> (insert-buffer-substring (current-buffer) start end)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> (forward-line -1)))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">(global-set-key (kbd "C-=") 'duplicate-one-line)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">(defun move-one-line-downward ()</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> "Move current line downward once."</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> (interactive)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> (forward-line)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> (transpose-lines 1)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> (forward-line -1))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">(global-set-key (kbd "C-down") 'move-one-line-downward)</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">(defun move-one-line-upward ()</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> "Move current line upward once."</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> (interactive)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> (transpose-lines 1)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> (forward-line -2))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">(global-set-key (kbd "C-up") 'move-one-line-upward)<br>
<br>(defvar previous-column nil "Save the column position")<br>(defun nuke-line ()<br> "Kill current line and restore column position."<br> (interactive)<br> (setq previous-column (current-column))<br>
(kill-entire-line 1)<br> (move-to-column previous-column))<br>(global-set-key [(shift delete)] 'nuke-line)<br><br><span style="font-family: arial,sans-serif;">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 column position.<br>
<br>Taken from: <a href="http://exceedhl.wordpress.com/2006/07/13/tweak-emacs/">http://exceedhl.wordpress.com/2006/07/13/tweak-emacs/</a><br><br>This one makes Shift+Backspace delete all whitespace around the cursor:<br></span>(global-set-key (kbd "S-BS") 'delete-horizontal-space)</span><br>
<span style="font-family: courier new,monospace;"><span style="font-family: arial,sans-serif;"><br>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.<br>
<br>Cheers!<br>Adam<br>--<br>Adam Lindberg<br><a href="http://www.erlang-consulting.com">http://www.erlang-consulting.com</a><br></span></span>