From 1ca2f06c16d8cf55e8ecc9133373b7a47f98421e Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 28 Feb 2017 18:07:30 -0500 Subject: [PATCH] feature/evil (neotree): don't ask for confirmation when creating files --- modules/feature/evil/config.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/modules/feature/evil/config.el b/modules/feature/evil/config.el index d52d048cb..1796ec77a 100644 --- a/modules/feature/evil/config.el +++ b/modules/feature/evil/config.el @@ -386,6 +386,13 @@ (push neo-buffer-name winner-boring-buffers) + ;; Don't ask for confirmation when creating files + (defun +evil*neotree-create-node (orig-fun &rest args) + "Don't ask for confirmation when creating files" + (cl-letf (((symbol-function 'yes-or-no-p) (lambda (&rest _) t))) + (apply orig-fun args))) + (advice-add 'neotree-create-node :around '+evil*neotree-create-node) + ;; Adding keybindings to `neotree-mode-map' wouldn't work for me (they get ;; overridden when the neotree buffer is spawned). So we bind them in a hook. (add-hook 'neo-after-create-hook '+evil|neotree-init-keymap)