Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add :badd #1918

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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