Add custom helm-projectile functions to mode map

helm-projectile's use package was reindented because it was not at the
correct level before.
This commit is contained in:
Ivan Malison 2016-06-21 14:55:32 -07:00
parent d14005fd18
commit e3d4b7aed0

View File

@ -1593,42 +1593,45 @@ I use helm for almost all emacs completion
(helm-mode 1))) (helm-mode 1)))
#+END_SRC #+END_SRC
[[(helm split window)][Ensure that helm buffers are started in the window that currently holds the focus]] [[(helm split window)][Ensure that helm buffers are started in the window that currently holds the focus]]
*** helm-projectile
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp
(use-package helm-projectile (use-package helm-projectile
:commands (helm-projectile-on) :commands (helm-projectile-on)
:preface :bind (:map helm-projectile-projects-map
(progn ("M-s" . imalison:switch-to-project-and-search)
(defun imalison:invalidate-cache-and-open-file (_dir) ("M-t" . imalison:helm-term-projectile))
(projectile-invalidate-cache nil) :preface
(projectile-find-file)) (progn
(defun imalison:invalidate-cache-and-open-file (_dir)
(projectile-invalidate-cache nil)
(projectile-find-file))
(defun imalison:switch-to-project-and-search (dir) (defun imalison:switch-to-project-and-search (dir)
(let ((default-directory dir) (let ((default-directory dir)
(projectile-require-project-root nil) (projectile-require-project-root nil)
(helm-action-buffer "this-buffer-should-not-exist")) (helm-action-buffer "this-buffer-should-not-exist"))
(helm-projectile-ag))) (helm-projectile-ag)))
(defun imalison:helm-term-projectile (dir) (defun imalison:helm-term-projectile (dir)
(let ((default-directory dir) (let ((default-directory dir)
(projectile-require-project-root nil) (projectile-require-project-root nil)
(helm-action-buffer "this-buffer-should-not-exist")) (helm-action-buffer "this-buffer-should-not-exist"))
(term-projectile-forward)))) (term-projectile-forward))))
:config :config
(progn (progn
(helm-delete-action-from-source "Search in Project" (helm-delete-action-from-source "Search in Project"
helm-source-projectile-projects) helm-source-projectile-projects)
(helm-delete-action-from-source "Open term for project" (helm-delete-action-from-source "Open term for project"
helm-source-projectile-projects) helm-source-projectile-projects)
(helm-add-action-to-source "Search in Project" (helm-add-action-to-source "Search in Project"
'imalison:switch-to-project-and-search 'imalison:switch-to-project-and-search
helm-source-projectile-projects) helm-source-projectile-projects)
(helm-add-action-to-source "Invalidate Cache and Open File" (helm-add-action-to-source "Open term for project"
'imalison:invalidate-cache-and-open-file 'imalison:helm-term-projectile
helm-source-projectile-projects) helm-source-projectile-projects)
(helm-add-action-to-source "Open term for project" (helm-add-action-to-source "Invalidate Cache and Open File"
'imalison:helm-term-projectile 'imalison:invalidate-cache-and-open-file
helm-source-projectile-projects))) helm-source-projectile-projects)))
#+END_SRC #+END_SRC
*** projectile *** projectile
#+BEGIN_SRC emacs-lisp #+BEGIN_SRC emacs-lisp