blob: 49dce803d98d50bc148e4a4eb4a1e8fe768b4b4f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
|
;;; init-navigation.el --- Navigation Configuration File -*- lexical-binding: t -*-
;;; Commentary:
;;; Code:
(use-package ctrlf
:init
(ctrlf-mode +1)
:config
(add-to-list 'ctrlf-minibuffer-bindings '("C-M-g" . ctrlf-cancel))
(add-to-list 'ctrlf-minibuffer-bindings '("C-o o" . ctrlf-occur))
(add-to-list 'ctrlf-minibuffer-bindings '("C-o C-o" . ctrlf-occur))
:custom
(ctrlf-default-search-style 'fuzzy-regexp)
(ctrlf-alternate-search-style 'literal)
:bind
("C-S-s" . ctrlf-forward-default)
("C-M-g" . ctrlf-cancel) ;; always bind this in case we have left the minibuffer
("C-*" . ctrlf-forward-symbol-at-point))
(use-package smartscan
:config
(global-smartscan-mode t)
:hook
(cider-repl-mode . (lambda () (smartscan-mode -1)))
(ielm-mode . (lambda () (smartscan-mode -1)))
(vterm-mode . (lambda () (smartscan-mode -1)))
(eshell-mode . (lambda () (smartscan-mode -1))))
(use-package affe
:after (consult orderless)
:config
(setq affe-grep-command (replace-regexp-in-string "\\." "-Suu ." affe-grep-command))
(when (and (eq system-type 'darwin) (string-match-p "^find" affe-find-command))
(setq affe-find-command (concat "g" affe-find-command)))
;; Configure Orderless
(setq affe-regexp-function #'orderless-pattern-compiler
affe-highlight-function #'orderless--highlight)
;; Manual preview key for `affe-grep'
(consult-customize affe-grep :preview-key (kbd "M-."))
(defun my/affe-grep-symbol-at-point (&optional dir initial)
(interactive
(list prefix-arg (when-let ((s (symbol-at-point)))
(symbol-name s))))
(affe-grep dir initial))
(defun my/affe-find-symbol-at-point (&optional dir initial)
(interactive
(list prefix-arg (when-let ((s (symbol-at-point)))
(symbol-name s))))
(affe-find dir initial))
:custom
(affe-find-command "fd --color never -t f")
:bind
("C-#" . affe-grep)
("C-c z" . affe-find)
("C-c Z" . my/affe-find-symbol-at-point)
("C-~" . my/affe-grep-symbol-at-point))
;; TODO - which of these are useful?
(use-package avy
:after key-chord
:custom
(avy-background t)
(avy-style 'pre)
:config
(key-chord-define-global "LL" 'avy-goto-line)
(key-chord-define-global ",," 'avy-goto-char-in-line)
(key-chord-define-global "jj" 'avy-goto-word-1)
(key-chord-define-global "jk" 'avy-goto-char)
:bind
("C-:" . avy-goto-char)
("C-'" . avy-goto-char-2)
("C-;" . avy-goto-char-in-line)
("C-c C-v" . avy-goto-char-in-line)
("C-c v" . avy-goto-word-or-subword-1)
("M-g w" . avy-goto-word-1)
("M-g M-w" . avy-goto-word-0)
("M-g M-f" . avy-goto-line))
(use-package rg
:config
(rg-enable-default-bindings))
(provide 'init-navigation)
;;; init-navigation.el ends here
|