forked from purcell/emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinit-anything.el
58 lines (48 loc) · 1.58 KB
/
init-anything.el
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
(require 'anything)
(require 'anything-config)
(require 'anything-match-plugin)
(defun fg/anything-jump ()
(interactive)
(anything-other-buffer
'(anything-c-source-buffers
anything-c-source-recentf
fg/anything-c-source-file-search)
" *fg/anything-jump*"))
(defun fg/anything-describe ()
(interactive)
(anything-other-buffer
'(anything-c-source-de
anything-c-source-recentf
fg/anything-c-source-file-search)
" *fg/anything-jump*"))
(defun fg/anything-man-pages ()
(interactive)
(anything-other-buffer
'(anything-c-source-man-pages)
" *fg/anything-man-pages*"))
(defun fg/anything-info-pages ()
(interactive)
(anything-other-buffer
'(anything-c-source-info-pages)
" *fg/anything-info-pages*"))
;; http://www.emacswiki.org/emacs/AnythingSources#toc14
(defvar fg/anything-c-source-file-search
'((name . "File Search")
(init . (lambda () (setq anything-default-directory default-directory)))
(candidates . (lambda ()
(let ((args
(format "%s -iname '*%s*' -print"
anything-default-directory
anything-pattern)))
(start-process-shell-command "file-search-process" nil
"find" args))))
(type . file)
(requires-pattern . 4)
(delayed))
"Source for searching matching files recursively.")
(defun fg/anything-rgrep ()
(interactive)
(let ((current-prefix-arg '(4)))
(call-interactively 'anything-do-grep)))
(ac-mode)
(provide 'init-anything)