aboutsummaryrefslogtreecommitdiff
path: root/emacs
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <msabate@suse.com>2016-10-27 10:41:12 +0200
committerMiquel Sabaté Solà <msabate@suse.com>2016-10-27 10:41:12 +0200
commitcee296c136da30b0c3b048d8667ff27fd84ec9a2 (patch)
tree71b7b930e00c683dfac9491ce8fd7fc05e7fc149 /emacs
parent3b2911c71db1aaf1bd1068d1fcbf5d9ea51c1abb (diff)
downloaddotfiles-cee296c136da30b0c3b048d8667ff27fd84ec9a2.tar.gz
dotfiles-cee296c136da30b0c3b048d8667ff27fd84ec9a2.zip
emacs: make helm-ag work in all cases
Signed-off-by: Miquel Sabaté Solà <msabate@suse.com>
Diffstat (limited to 'emacs')
-rw-r--r--emacs/init.el11
1 files changed, 10 insertions, 1 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 3d70ae4..3ad50d3 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -328,6 +328,15 @@ Idea taken from @purcell."
:config
(helm-projectile-on))
+(defun mssola-helm-ag ()
+ "Call the right ag command for helm-ag."
+
+ (interactive)
+
+ (condition-case nil
+ (helm-ag-project-root)
+ (error (helm-ag))))
+
(defun mssola-find-file ()
"Call the proper Helm function for finding files."
@@ -434,7 +443,7 @@ then it takes a second \\[keyboard-quit] to abort the minibuffer."
(setq evil-leader/in-all-states 1)
(evil-leader/set-key
"," 'back-to-indentation
- "a" 'helm-ag-project-root ; TODO: non-projects
+ "a" 'mssola-helm-ag
"c" 'delete-window
"k" 'kill-buffer-and-window
"v" 'split-window-right