Projectile工程管理

Table of Contents

Projectile - Project management

Configuration

(use-package projectile
;; :defer t
:diminish projectile-mode
:config
(progn
(setq projectile-keymap-prefix (kbd "C-c p"))
(setq projectile-completion-system 'default)
(setq projectile-enable-caching t)
(setq projectile-indexing-method 'alien)
(add-to-list 'projectile-globally-ignored-files "node-modules")
;; setting for projectile
(setq projectile-other-file-alist '(("cpp" "h" "hpp" "ipp")
("ipp" "h" "hpp" "cpp")
("hpp" "h" "ipp" "cpp")
("cxx" "hxx" "ixx")
("ixx" "cxx" "hxx")
("hxx" "ixx" "cxx")
("c" "h")
("m" "h")
("mm" "h")
("h" "c" "cpp" "ipp" "hpp" "m" "mm")
("cc" "hh")
("hh" "cc")
("vert" "frag")
("frag" "vert")
(nil "lock" "gpg")
("lock" "")
("gpg" "")
("js" "css" "html")))
(add-to-list 'projectile-other-file-alist '("css" "js")) ;; switch from css -> js
(add-to-list 'projectile-other-file-alist '("js" "css")) ;; switch from js -> css
;; setting for helm-projectile
;;(setq projectile-switch-project-action 'helm-projectile-find-file)
(setq projectile-switch-project-action 'helm-projectile)
)
:config
(projectile-global-mode))
(use-package helm-projectile
:defer t
:init
(setq helm-projectile-fuzzy-match t)
)

Key binding for helm-projectile

;; -----------------------------------------
;; helm-project
;; -----------------------------------------
(global-set-key (kbd "C-c h") 'helm-projectile)
;; Grep in a projectile
(global-set-key (kbd "C-c p s g") 'helm-projectile-grep)