86 lines
2.1 KiB
EmacsLisp
86 lines
2.1 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)
|
|
:map visual-line-mode-map
|
|
("C-a" . mwim-beginning)
|
|
("C-e" . mwim-end))
|
|
:init
|
|
(defun mwim-visual-line-end ()
|
|
(mwim-point-at
|
|
(end-of-visual-line)))
|
|
(defun mwim-visual-line-beginning ()
|
|
(mwim-point-at
|
|
(beginning-of-visual-line)))
|
|
:custom
|
|
(mwim-beginning-position-functions
|
|
'(mwim-visual-line-beginning
|
|
mwim-line-beginning
|
|
mwim-code-beginning
|
|
mwim-comment-beginning))
|
|
(mwim-end-position-functions
|
|
'(mwim-visual-line-end
|
|
mwim-block-end
|
|
mwim-code-end
|
|
mwim-line-end)))
|
|
|
|
;; 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
|
|
: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))
|
|
|
|
:demand t
|
|
:config
|
|
(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))
|
|
|
|
(use-package vundo
|
|
:ensure t
|
|
:bind ("M-/" . vundo))
|
|
|
|
(use-package outli
|
|
:ensure (:host github :repo "jdtsmith/outli")
|
|
:bind (:map outli-mode-map
|
|
("C-c C-p" . outline-back-to-headking))
|
|
:hook ((prog-mode text-mode) . outli-mode))
|