Files
dotfiles/thoom-emacs/modules/thoom-editing.el

67 lines
1.6 KiB
EmacsLisp

(provide 'thoom-editing)
(use-package mwim
:ensure t
:bind (([remap move-beginning-of-line] . mwim-beginning)
([remap move-end-of-line] . mwim-end))
:init
(defun thoom/mwim-org-heading-beginning ()
(mwim-point-at
(move-beginning-of-line nil)
(skip-syntax-forward "_ " (line-end-position))))
:config
(setq mwim-beginning-position-functions
'(thoom/mwim-org-heading-beginning
mwim-code-beginning
mwim-comment-beginning
mwim-line-beginning)))
;; Allow movement during isearch
;; C/M-v move to next/previous match not currently visible
;; M-</> move to first/last match in buffer
(setq isearch-allow-motion t)
(setq isearch-wrap-pause nil)
(use-package avy
:ensure t
:defer nil
:bind
(("C-j" . avy-goto-char-timer)
([remap goto-line] . avy-goto-line)
:map isearch-mode-map
("C-j" . avy-isearch)
:map lisp-interaction-mode-map
("C-j" . nil))
:init
(defun avy-action-embark (pt)
(unwind-protect
(save-excursion
(goto-char pt)
(embark-act))
(select-window
(cdr (ring-ref avy-ring 0))))
t)
(setf (alist-get ?\; avy-dispatch-alist) 'avy-action-embark)
(setq avy-timeout-seconds 0.25)
;; Always show candidates even when there's just one, to give an
;; opportunity to select an avy action
(setq avy-single-candidate-jump nil))
(use-package avy-zap
:ensure t
:bind (("C-z" . avy-zap-up-to-char-dwim)
("M-z" . avy-zap-to-char-dwim)))
(use-package expand-region
:ensure t
:bind (("C-=" . er/expand-region)))
(use-package dot-mode
:ensure t
:config
(global-dot-mode t))