aboutsummaryrefslogtreecommitdiff
path: root/Emacs
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-04-23 01:40:07 +0530
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-04-23 01:40:07 +0530
commit5aec6298cfc2ca9889f9fababf5d38281ce0a192 (patch)
tree4828ba067d359bc189bce048bf24317fcb1c94f0 /Emacs
parenta6fe9aaf6ebe7232f54f17ac86f5384617bc6fe5 (diff)
downloaddotfiles-5aec6298cfc2ca9889f9fababf5d38281ce0a192.tar.gz
dotfiles-5aec6298cfc2ca9889f9fababf5d38281ce0a192.tar.bz2
dotfiles-5aec6298cfc2ca9889f9fababf5d38281ce0a192.zip
(Emacs/config|core)+move-line-{up|down}
Diffstat (limited to 'Emacs')
-rw-r--r--Emacs/.config/emacs/config.org21
-rw-r--r--Emacs/.config/emacs/core.org5
2 files changed, 26 insertions, 0 deletions
diff --git a/Emacs/.config/emacs/config.org b/Emacs/.config/emacs/config.org
index 8d2c83d..9df46d4 100644
--- a/Emacs/.config/emacs/config.org
+++ b/Emacs/.config/emacs/config.org
@@ -184,6 +184,27 @@ any buffers in ~+oreo/keep-buffer~ and kills the rest.
(kill-buffer buf)))
(buffer-list)))
#+end_src
+** Move line {up/down}
+Shamelessly copied from
+[[https://emacsredux.com/blog/2013/04/02/move-current-line-up-or-down/][this
+article]]. Will be bound in [[file:core.org::*Some binds in
+Emacs][core.org]].
+#+begin_src emacs-lisp
+(defun move-line-up ()
+ "Move up the current line."
+ (interactive)
+ (transpose-lines 1)
+ (forward-line -2)
+ (indent-according-to-mode))
+
+(defun move-line-down ()
+ "Move down the current line."
+ (interactive)
+ (forward-line 1)
+ (transpose-lines 1)
+ (forward-line -1)
+ (indent-according-to-mode))
+#+end_src
* Aesthetics
General look and feel of Emacs (mostly disabling stuff I don't like).
** Themes
diff --git a/Emacs/.config/emacs/core.org b/Emacs/.config/emacs/core.org
index bc3a2cd..b0d7e2f 100644
--- a/Emacs/.config/emacs/core.org
+++ b/Emacs/.config/emacs/core.org
@@ -119,6 +119,11 @@ Some bindings that I couldn't fit elsewhere easily.
("C-x d" #'delete-frame)
(nmmap
+ :keymaps 'override
+ "C-M-j" #'move-line-down
+ "C-M-k" #'move-line-up)
+
+ (nmmap
"C--" #'text-scale-decrease
"C-=" #'text-scale-increase
"C-+" #'text-scale-adjust)