summaryrefslogtreecommitdiffstats
path: root/init.el
diff options
context:
space:
mode:
authorAmin Bandali <bandali@gnu.org>2020-04-13 12:15:22 -0400
committerAmin Bandali <bandali@gnu.org>2020-04-13 12:15:22 -0400
commitc64e010d0b51f1914d9bca263063506be9420540 (patch)
tree955529778a69651679f78bf9a0e004a8f640c0ad /init.el
parent5b99021902255e23769e5982b92338a73974d2b2 (diff)
downloadconfigs-c64e010d0b51f1914d9bca263063506be9420540.tar.gz
configs-c64e010d0b51f1914d9bca263063506be9420540.tar.xz
configs-c64e010d0b51f1914d9bca263063506be9420540.zip
Add convenience b/move-indentation-or-beginning-of-line, bind to C-a
Diffstat (limited to 'init.el')
-rw-r--r--init.el12
1 files changed, 12 insertions, 0 deletions
diff --git a/init.el b/init.el
index 23158a1..e633282 100644
--- a/init.el
+++ b/init.el
@@ -239,6 +239,17 @@ For disabling the behaviour for certain buffers and/or modes."
(interactive)
(kill-buffer (current-buffer)))
+(defun b/move-indentation-or-beginning-of-line (arg)
+ "Move to the indentation or to the beginning of line."
+ (interactive "^p")
+ ;; (if (bolp)
+ ;; (back-to-indentation)
+ ;; (move-beginning-of-line arg))
+ (if (= (point)
+ (progn (back-to-indentation)
+ (point)))
+ (move-beginning-of-line arg)))
+
;;; Defaults
@@ -490,6 +501,7 @@ For disabling the behaviour for certain buffers and/or modes."
;;; General bindings
(bind-keys
+ ("C-a" . b/move-indentation-or-beginning-of-line)
("C-c a i" . ielm)
("C-c e b" . eval-buffer)