[vim/vim] [Feature] Ex Command To Exit the Current Buffer (PR #18970)

2 views
Skip to first unread message

bfoersterling

unread,
11:42 AM (4 hours ago) 11:42 AM
to vim/vim, Subscribed

Feature

Introduce new ex command :bx[it].

Similar to :x but in the context of the current buffer.

Rationale

When editing a lot of files a command to save and exit the buffer would be
convenient.

If you are editing a buffer, want to save it, discard it, and continue working
at the previous buffer you have to type :w<CR>, then :bw<CR>.
With this feature you could just do the changes, type :bx<CR> and edit the next buffer.
Especially when editing a lot of files this would save time.
Similar to :x to save and quit vim which is such an improvement over :wq.
This would also help to not clutter up the buffer list.

If there already is a way to do this - please let me know.


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/18970

Commit Summary

File Changes

(4 files)

Patch Links:


Reply to this email directly, view it on GitHub.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18970@github.com>

gcanat

unread,
12:29 PM (3 hours ago) 12:29 PM
to vim/vim, Subscribed
gcanat left a comment (vim/vim#18970)

What's wrong with doing all your edits in the various buffers and saving after you are done ? :wa
Do you really need to wipe each buffer individually after edit ?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18970/c3675923542@github.com>

bfoersterling

unread,
12:45 PM (3 hours ago) 12:45 PM
to vim/vim, Push

@bfoersterling pushed 24 commits.

  • 3d70e74 new ex cmd :bx to close and save the current buffer
  • b44613a added comment
  • 80d034e EX_RANGE, EX_EXTRA, EX_BUFNAME, and EX_COUNT are unnecessary
  • 9cc37f1 fix make test test_list_cmds
  • 5e42f26 only write if current buffer has changed
  • 45cb508 added error handling for do_write
  • e0b2e28 do error handling with eap->errmsg
  • c683eea EX_FILE1 is not suited for :bx
  • 8dc4205 added test for bexit
  • 154eb59 changed comments
  • d1d1202 updated comments
  • 613cb70 fixed assert_equal argument order
  • 6a4341f added comment to test and renamed variable
  • 157f794 added test for unmodified buffer
  • 39e510a added test for :bx with trailing buffer number
  • 1ae6005 added test for unnamed buffers
  • 5012377 setting eap->errmsg does not actually do anything
  • 39b8012 sorted test function and macro alphabetically
  • 7ffb491 added documentation for :bx
  • 9c674f1 updated index
  • 262efc4 put bexit near bunload in ec_docmd.c
  • b76d3e2 updated docs
  • 22049d8 use vim style if statements without braces
  • ebae529 Merge branch 'ex-cmd-bx' into ex-cmd-bxit


View it on GitHub or unsubscribe.
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18970/before/685744f57247fa552f9de4114cce7b599387c779/after/ebae52985386c7cd27e023995d06d0c80768f8d9@github.com>

bfoersterling

unread,
12:47 PM (3 hours ago) 12:47 PM
to vim/vim, Subscribed
bfoersterling left a comment (vim/vim#18970)

What's wrong with doing all your edits in the various buffers and saving after you are done ? :wa Do you really need to wipe each buffer individually after edit ?

It clutters up the buffer list and you can't just move between buffers with :bn and :bp.


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18970/c3675973342@github.com>

Christian Brabandt

unread,
1:07 PM (3 hours ago) 1:07 PM
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#18970)

And what is wrong with :bd and :bw?


Reply to this email directly, view it on GitHub.

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/18970/c3676024090@github.com>

Reply all
Reply to author
Forward
0 new messages