Skip to content

Commit

Permalink
Add :badd
Browse files Browse the repository at this point in the history
  • Loading branch information
tomdl89 committed Jun 27, 2024
1 parent 0ad84c5 commit 0347d79
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions evil-commands.el
Original file line number Diff line number Diff line change
Expand Up @@ -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 "<f>")
(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
Expand Down
1 change: 1 addition & 0 deletions evil-maps.el
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 0347d79

Please sign in to comment.