blob: 659fb2f9c9072cfd2db47e0d545845b4ea80f53b (
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
|
;; projectile fails to load subr-x under some circumstances
;; https://github.com/bbatsov/projectile/issues/1382
(use-package subr-x
:ensure nil) ;; package is bundled with emacs
(use-package projectile
:after subr-x
:diminish projectile-mode
:init
;; use git grep
(setq projectile-use-git-grep t)
;; switching project opens the top-level directory
(setq projectile-switch-project-action 'projectile-dired)
;; ignore remote projects
(setq projectile-ignored-project-function 'file-remote-p)
;; enable caching
(setq projectile-enable-caching t)
;; avoid reading command when compiling
(setq compilation-read-command nil)
;; use ivy for completion
(setq projectile-completion-system 'ivy)
;; set prefix
:bind-keymap
("C-c p" . projectile-command-map)
:bind (;; C-x f finds file in project
("C-x f" . projectile-find-file)
;; C-c g runs git grep in project
("C-c g" . projectile-grep)
;; C-c m compiles project
;; C-u C-c m will force reading command
("C-c m" . projectile-compile-project))
:config
(projectile-mode 1))
(provide 'init-projectile)
|