On Tue, June 25, 2013 13:16, Tony Mechelynck wrote: > On 25/06/13 11:15, Christian Brabandt wrote: >> On Mon, June 24, 2013 23:54, Paul Maier wrote: >>> Hi, >>> >>> the original vi on Sun took :su as :suspend, >>> whereas vim takes :su as :substitute. >>> >>> I am very used to typing :su. >>> >>> Would it be possible for VIM 7.4 to add a new compatibility flag to >>> cpoptions >>> about the meaning of :su ? >>> >>> suggested compatible flag: :su = :suspend, :s = :substitute >>> without the flag: :su = :substitute >>> >> >> Looks like a bug to me. POSIX also requires :su to be used for >> :suspend (http://pubs.opengroup.org/onlinepubs/007908799/xcu/ex.html) >> >> Do we need a new cpo setting here, or should it be enough to >> patch vim to take :su as :suspend? > > Looks like a feature, not a bug, to me. Vim does not always follow what > the POSIX pundits decreed from their high thrones that vi “must” do, > especially not in 'nocompatible' mode but not even in 'compatible' mode, > unless $VIM_POSIX is set (or the individual POSIX flags are set in > addition to the 'compatible' ones). > > The Vim documentation clearly specifies :s[ubstitute], :sus[pend], > st[op], which, in the notation used in Vim help files, means that: > :s > :su > :sub > :subs > :subst > :substi > :substit > :substitu > :substitut > :substitute > all mean the same, > > and (since :stop and :suspend are synonymous not only in Vim but also in > vi and ex): > :sus > :susp > :suspe > :suspen > :suspend > :st > :sto > :stop > also all mean the same. > > IMHO the mention of s[ubstitute] and su[spend] in the POSIX manual is > where the bug lies, since it implies that :su would mean _both_ :suspend > and :substitute.
No it isn't. The standard allows either :su or :suspend but none of the other ways. The same is true for :substitute, either use :s or :substitute. There is no ambiguity as you claim. > Since the popular :s command is a well-known > abbreviation for :substitute, it follows (by analogy with all other > ex-commands used in Vim) that :su, :sub, :subs, etc. mean the same. An We also already have :si (which is short for :s using i flag), but :sil is used for :silent and :sl is used for sleep. > additional letter must be used for :sus[pend] to avoid ambiguity, or > people who want to press as few keys as possible, :st[op] comes to the > rescue. > To have :s = :substitute, :su = :suspend, :sub = :substitute would be > illogical and would add an element of surprise for people like me, who > never used legacy vi. Why. Do you use :su instead of :s? I don't see how that would be surprising but instead it would be more logically to users of the old vanilla vi. > A cabbrev has been given for those who want it this way nevertheless. Do > we need an additional POSIX flag in 'cpoptions' and a change in the C > code? I personally doubt its utility. regards, Christian -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.