Replace personal C-a hack with mwim
This commit is contained in:
@@ -1,19 +1,20 @@
|
|||||||
(provide 'thoom-editing)
|
(provide 'thoom-editing)
|
||||||
|
|
||||||
;; TODO Support comments
|
(use-package mwim
|
||||||
(defun move-to-beginnings ()
|
:ensure t
|
||||||
"Move between possible beginnings of a line:
|
:bind (([remap move-beginning-of-line] . mwim-beginning)
|
||||||
The very beginning, the start of an org headline, and the first non-whitespace character."
|
([remap move-end-of-line] . mwim-end))
|
||||||
(interactive "^")
|
:init
|
||||||
(cond
|
(defun thoom/mwim-org-heading-beginning ()
|
||||||
((not (bolp))
|
(mwim-point-at
|
||||||
(move-beginning-of-line 1))
|
(move-beginning-of-line nil)
|
||||||
((org-at-heading-p)
|
(skip-syntax-forward "_ " (line-end-position))))
|
||||||
(search-forward-regexp "*+ *" nil t))
|
:config
|
||||||
(t (back-to-indentation))))
|
(setq mwim-beginning-position-functions
|
||||||
|
'(mwim-code-beginning
|
||||||
(use-package emacs
|
thoom/mwim-org-heading-beginning
|
||||||
:bind (("C-a" . move-to-beginnings)))
|
mwim-comment-beginning
|
||||||
|
mwim-line-beginning)))
|
||||||
|
|
||||||
;; Allow movement during isearch
|
;; Allow movement during isearch
|
||||||
;; C/M-v move to next/previous match not currently visible
|
;; C/M-v move to next/previous match not currently visible
|
||||||
|
|||||||
Reference in New Issue
Block a user