forked from magnars/.emacs.d
-
Notifications
You must be signed in to change notification settings - Fork 1
/
setup-ffip.el
41 lines (30 loc) · 1.06 KB
/
setup-ffip.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
(require 'find-file-in-project)
;; Use eproject to find project root
(setq ffip-project-root-function 'eproject-root)
;; No need to be stingy
(setq ffip-limit 4096)
;; Helper methods to create local settings
(defun ffip--create-exclude-find-options (names)
(mapconcat (lambda (name)
(concat "-not -regex \".*" name ".*\"")) names " "))
(defun ffip-local-excludes (&rest names)
"Given a set of names, will exclude results with those names in the path.
Example:
(ffip-local-excludes \"target\" \"overlays\")
"
(set (make-local-variable 'ffip-find-options)
(ffip--create-exclude-find-options names)))
(defun ffip-local-patterns (&rest patterns)
"An exhaustive list of file name patterns to look for.
Example:
(ffip-local-patterns \"*.js\" \"*.jsp\" \"*.css\")
"
(set (make-local-variable 'ffip-patterns) patterns))
;; Default excludes - override with ffip-local-excludes
(setq ffip-find-options
(ffip--create-exclude-find-options
'("node_modules"
"target"
"overlays"
"vendor")))
(provide 'setup-ffip)