Browse code
feat(emacs): projectile-independent " f"
Showing 1 changed files
... | ... |
@@ -16,6 +16,33 @@ |
16 | 16 |
(use-package undo-fu |
17 | 17 |
:ensure t) |
18 | 18 |
|
19 |
+ |
|
20 |
+(defun fwoar::get-candidates () |
|
21 |
+ (funcall (-compose (fwoar/exclude |
|
22 |
+ (fwoar/matches-regex "/\\(.*[#]\\)")) |
|
23 |
+ 'project-files |
|
24 |
+ 'project-current))) |
|
25 |
+ |
|
26 |
+(defun fwoar::browse-project () |
|
27 |
+ (interactive) |
|
28 |
+ (if (package-installed-p 'projectile) |
|
29 |
+ (helm-projectile) |
|
30 |
+ (fwoar::helm-find-file-in-project))) |
|
31 |
+ |
|
32 |
+(defvar fwoar::*helm-project-files-source* |
|
33 |
+ `((name . "Project Files") |
|
34 |
+ (candidates . (lambda () |
|
35 |
+ (let* ((fwoar::project (project-current)) |
|
36 |
+ (fwoar::root (project-root fwoar::project))) |
|
37 |
+ (mapcar (lambda (it) |
|
38 |
+ (cons (f-relative it fwoar::root) |
|
39 |
+ it)) |
|
40 |
+ (project-files fwoar::project))))) |
|
41 |
+ (action . helm-find-files-actions))) |
|
42 |
+(defun fwoar::helm-find-file-in-project () |
|
43 |
+ (interactive) |
|
44 |
+ (helm '(fwoar::*helm-project-files-source*))) |
|
45 |
+ |
|
19 | 46 |
(use-package evil |
20 | 47 |
:ensure t |
21 | 48 |
:after undo-fu |
... | ... |
@@ -41,7 +68,7 @@ |
41 | 68 |
(evil-set-leader '(normal visual) (kbd "<SPC>")) |
42 | 69 |
|
43 | 70 |
(progn ;; navigation |
44 |
- (evil-define-key 'normal 'global (kbd "<leader>f") 'helm-projectile) |
|
71 |
+ (evil-define-key 'normal 'global (kbd "<leader>f") 'fwoar::browse-project) |
|
45 | 72 |
(evil-define-key 'normal 'global (kbd "<leader>;") 'helm-semantic-or-imenu) |
46 | 73 |
(evil-define-key 'normal 'global (kbd "<leader>j") 'helm-buffers-list) |
47 | 74 |
(comment |