blob: 1e4bc5570a4203a80ac6931f548a38216f10a273 (
plain)
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
|
;;; Ace Jump
(key-chord-define-global ";a" 'ace-jump-mode)
(setq ace-jump-mode-scope 'frame)
;;; Ace Link
(ace-link-setup-default)
(after 'org
(define-key org-mode-map (kbd "C-c m o") 'ace-link-org))
(defun km/ace-link-dired ()
"Ace jump to files in dired buffers."
(interactive)
(ali-generic
(km/ali--dired-collect-references)
(org-open-file (dired-get-filename))))
(defun km/ali--dired-collect-references ()
(let ((end (window-end))
points)
(save-excursion
(goto-char (window-start))
(while (< (point) end)
(--when-let (dired-next-line 1)
(push it points)))
(nreverse points))))
(after 'dired
;; This overrides the binding for `dired-find-file-other-window', which
;; is rebound to 'r'.
(define-key dired-mode-map "o" 'km/ace-link-dired)
(define-key dired-mode-map "r" 'dired-find-file-other-window))
;;; Ace Window
(define-key km/window-map "a" 'ace-window)
(setq aw-keys '(?a ?s ?d ?f ?g ?h ?j ?k ?l)
aw-scope 'global)
(key-chord-define-global ",w" 'ace-window)
(provide 'init-ace)
|