1

Similar question, yet not duplicate of: How can I reload all buffers at once?

If :wa writes all, would not :ea be expected to reload all?

How could one script :ea to behave this way?

What are the cases when a append works or not?

fde-capu
  • 283
  • 1
  • 11
  • Could you explain a bit more why it's not a duplicate? Why don't the answers to the linked question work for you? – Rich Feb 11 '20 at 11:47
  • Is it just that you literally want to type :ea? – Rich Feb 11 '20 at 12:09
  • @Rich, why wouldn't I? If :qa is equivalent to :bufdo q, why isn't :ea as like? Not duplicate, it does not mention (possibility of?) the a append. – fde-capu Feb 11 '20 at 13:15
  • 1
    I wasn't second guessing your motivation: I just wasn't 100% sure what you were asking. – Rich Feb 11 '20 at 14:05

2 Answers2

4

While I cannot answer design questions, not being a designer, I would hazard a guess that :wall was provided as a shortcut for a very common operation (:bufdo write or similar), while we are left with :bufdo (and :argdo, :cdo, :windo, etc.) for the rest.

A user command:

command -bar -bang Eall bufdo<bang> edit<bang>

(You may not want both bangs; they do different things, so pick the ones that make sense to you.)

D. Ben Knoble
  • 26,070
  • 3
  • 29
  • 65
3

I think D. Ben Knoble's guess is as good as any as to why :editall hasn't been implemented to do what you want it to. Note that :ea already has a function (It's short for :earlier), and it's unlikely that this will ever be changed, as that would break backwards compatability.

If you want to make :ea instead reload all the buffers, you can use an abbreviation:

:cabbrev <expr> ea (getcmdtype() == ':' && getcmdpos() == 3) ? 'bufdo edit' : 'ea'

As for other commands that support an a[ll] suffix, here's a possibly incomplete list gleaned from the command: :helpgrep :\k*all\>:

  • :qa[ll]
  • :wqa[ll]
  • :doautoa[ll]
  • :xa[ll]
  • :ba[ll]
  • :packl[oadall]
  • :sal[l]
  • :sba[ll]
  • :spellr[epall]
  • :al[l]

(Just in case you weren't already aware of this, all command-line commands can be abbreviated to the shortest non-ambiguous prefix, hence the square brackets [] denoting the optional characters in the command.)

guntbert
  • 1,245
  • 1
  • 13
  • 27
Rich
  • 31,891
  • 3
  • 72
  • 139
  • :earlier Ns is a new topic for me; and nice hack, thanks! Only third question missing: "What are the cases when a append works?" – fde-capu Feb 11 '20 at 14:11
  • 1
    @fde-capu See edit for a list that may or may not cover them all. – Rich Feb 11 '20 at 14:37