diff --git a/evil-commands.el b/evil-commands.el index 4ad249fc..3a0b3b35 100644 --- a/evil-commands.el +++ b/evil-commands.el @@ -3349,6 +3349,14 @@ If no FILE is specified, reload the current buffer from disk as read-only." (revert-buffer bang (or bang (not (buffer-modified-p))) t) (read-only-mode +1))) +(evil-define-command evil-buffer-add (file) + "Add FILE to the buffer list, but don't visit it. " + :repeat nil + (interactive "") + (if (or (not file) (string= "" file)) + (user-error "No file specified") + (find-file-noselect file))) + (evil-define-command evil-read (count file) "Insert the contents of FILE below the current line or line COUNT." :repeat nil diff --git a/evil-maps.el b/evil-maps.el index 0dfa85dd..2add438c 100644 --- a/evil-maps.el +++ b/evil-maps.el @@ -515,6 +515,7 @@ included in `evil-insert-state-bindings' by default." (evil-ex-define-cmd "sav[eas]" 'evil-save) (evil-ex-define-cmd "r[ead]" 'evil-read) (evil-ex-define-cmd "b[uffer]" 'evil-buffer) +(evil-ex-define-cmd "bad[d]" 'evil-buffer-add) (evil-ex-define-cmd "bn[ext]" 'evil-next-buffer) (evil-ex-define-cmd "bp[revious]" 'evil-prev-buffer) (evil-ex-define-cmd "bN[ext]" "bprevious")