summary refs log tree commit diff stats
path: root/tag-emacs/emacs.d/elisp/shuffle-lines.el
diff options
context:
space:
mode:
Diffstat (limited to 'tag-emacs/emacs.d/elisp/shuffle-lines.el')
-rw-r--r--tag-emacs/emacs.d/elisp/shuffle-lines.el20
1 files changed, 20 insertions, 0 deletions
diff --git a/tag-emacs/emacs.d/elisp/shuffle-lines.el b/tag-emacs/emacs.d/elisp/shuffle-lines.el
new file mode 100644
index 00000000..be0a98f9
--- /dev/null
+++ b/tag-emacs/emacs.d/elisp/shuffle-lines.el
@@ -0,0 +1,20 @@
+;;;###autoload
+(defun move-line-down ()
+    (interactive)
+    (let ((col (current-column)))
+        (save-excursion
+            (forward-line)
+            (transpose-lines 1))
+        (forward-line)
+        (move-to-column col)))
+
+;;;###autoload
+(defun move-line-up ()
+    (interactive)
+    (let ((col (current-column)))
+        (save-excursion
+            (forward-line)
+            (transpose-lines -1))
+        (move-to-column col)))
+
+(provide 'shuffle-lines)