From e46f1d3dea4f7cda296628b81b174f6ed7a42032 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Thu, 20 Oct 2016 18:18:41 +0200 Subject: emacs: fix C-p for non-project situations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Miquel Sabaté Solà --- emacs/init.el | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'emacs') diff --git a/emacs/init.el b/emacs/init.el index 72ff2b7..7a3f8de 100644 --- a/emacs/init.el +++ b/emacs/init.el @@ -297,6 +297,16 @@ The user will end up in the *scratch* buffer." :config (helm-projectile-on)) +(defun mssola-find-file () + "Call the proper Helm function for finding files." + + (interactive) + + (condition-case nil + (helm-projectile-find-file) + (error + (helm-find-files nil)))) + ;; Rising from the deep flames of Hell: my Evil configuration. (defun mssola-evil () @@ -319,7 +329,7 @@ The user will end up in the *scratch* buffer." (fset 'help-command help-map) ; Helm + Projectile shortcuts. - (define-key evil-normal-state-map (kbd "C-p") 'helm-projectile-find-file) + (define-key evil-normal-state-map (kbd "C-p") 'mssola-find-file) (define-key evil-normal-state-map (kbd "M-p") 'helm-projectile-switch-project) ; I use the Super key in combination with j & k to move around i3. Let's unset -- cgit v1.2.3