From cee296c136da30b0c3b048d8667ff27fd84ec9a2 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 27 Oct 2016 10:41:12 +0200 Subject: emacs: make helm-ag work in all cases MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- emacs/init.el | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'emacs') 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 -- cgit v1.2.3