(provide 'thoom-editing) ;; TODO Support comments (defun move-to-beginnings () "Move between possible beginnings of a line: The very beginning, the start of an org headline, and the first non-whitespace character." (interactive "^") (cond ((not (bolp)) (move-beginning-of-line 1)) ((org-at-heading-p) (search-forward-regexp "*+ *" nil t)) (t (back-to-indentation)))) (use-package emacs :bind (("C-a" . move-to-beginnings))) ;; 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 (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))