summaryrefslogtreecommitdiff
path: root/emacs/inits/11-completion.el
diff options
context:
space:
mode:
authortslil clingman <>2021-07-02 17:41:10 -0400
committertslil clingman <>2021-07-02 17:41:10 -0400
commit443664ccf6c91a7061af449f38aef526ede5cbb7 (patch)
tree070b3442ff91301307219a916a3e54b3fecd526a /emacs/inits/11-completion.el
parent8281c600a8d712f2045dfc48f4bc17c21d135cc3 (diff)
custom abbreviate directory on modeline + consult-line as isearch
Diffstat (limited to 'emacs/inits/11-completion.el')
-rw-r--r--emacs/inits/11-completion.el22
1 files changed, 19 insertions, 3 deletions
diff --git a/emacs/inits/11-completion.el b/emacs/inits/11-completion.el
index 0206324..06296cf 100644
--- a/emacs/inits/11-completion.el
+++ b/emacs/inits/11-completion.el
@@ -1,4 +1,4 @@
-;; Time-stamp: <2021-06-29 17h26 EDT (hobbies)>
+;; Time-stamp: <2021-07-02 17h40 EDT (hobbies)>
;; -----------------------------------------------------------------------------
;; Vertico
@@ -64,7 +64,8 @@
;; M-g bindings (goto-map)
("M-g e" . consult-compile-error)
("M-g f" . consult-flymake) ;; Alternative: consult-flycheck
- ("M-g g" . consult-line) ;; orig. goto-line
+ ("C-s" . consult-line) ;; orig. goto-line
+ ("C-r" . isearch-forward-regexp)
("M-g M-g" . consult-goto-line) ;; orig. goto-line
("M-g o" . consult-outline) ;; Alternative: consult-org-heading
("M-g m" . consult-mark)
@@ -73,7 +74,7 @@
("M-g I" . consult-project-imenu)
;; M-s bindings (search-map)
("M-s f" . consult-find)
- ("M-s L" . consult-locate)
+ ("M-s L" . consult-locate)
("C-c g" . consult-ripgrep)
("C-c G" . consult-git-grep)
("M-s l" . consult-line)
@@ -112,6 +113,21 @@
consult--source-file consult--source-project-file consult--source-bookmark
:preview-key (kbd "M-."))
+ (defun previous-history-or-next ()
+ (interactive)
+ (if (string= "" (minibuffer-contents-no-properties))
+ (progn
+ (previous-history-element 1)
+ (end-of-line))
+ (vertico-next)))
+
+ (defvar my-consult-line-map
+ (let ((map (make-sparse-keymap)))
+ (define-key map "\C-s" #'previous-history-or-next)
+ map))
+
+ (consult-customize consult-line :keymap my-consult-line-map)
+
;; Optionally configure the narrowing key.
;; Both < and C-+ work reasonably well.
(setq consult-narrow-key "<") ;; (kbd "C-+")