* Benjamin R. Haskell <[email protected]> [120413 17:14]: > On Fri, 13 Apr 2012, Marvin Renich wrote: > >Using :dig! to display and :dig! xy to delete is terribly > >inconsistent. To remove a highlight, vim uses :hi clear, to > >remove a map, :unmap. I would suggest :undig {char}{char} or > >:undig {number} to remove a digraph. > > > >:dig! {char}{char} or :dig! {number} could be used to list > >digraphs matching certain criteria. > > Is there any current Vim command that uses "!" to indicate that > things will be listed? If not, this seems even more inconsistent. > "!" usually means "watch out!" (because something will be deleted, > e.g. :au!), or "I really mean it!" (because some safety check is > being removed, e.g. :[range]w!, or :w! {existing-file}). > > So, why not extend dig to take a first argument, the way :hi[light] > does, and add '!' to mean 'remove'? Ending up with something > similar to :au[tocmd]{,!}: > > " lack of {number} means list > :dig " list all digraphs > :dig user " list user-defined digraphs > :dig {char}{char} " list digraph for {char}{char} > > " specifying {number} means definition > :dig {char}{char} {number} " define digraph {char}{char} as {number} > > " ! means delete, with same arguments as the "list" forms > :dig! " delete all digraphs > :dig! user " delete all user-defined digraphs > :dig! {char}{char} " delete the digraph for {char}{char} > > > " specifying {number} and ! means replace (delete and then define) > :dig! {char}{char} {number} " replace {char}{char} digraph w/ {number}
I agree that ! usually means "override a safety feature," but I don't like it being used for delete; au! is the only example I can come up with where :foo adds something and :foo! deletes it. I much, much prefer :undig or :deldig. The analogy between the usage of :dig and :au is tenuous at best; :dig is more closely related to :map or :ab, both of which use :un prefix to delete. While I think that :dig! would be a very poor choice for delete, I am not at all set on using :dig! for listing. I would be just as happy to use :ldig or something else for listing and leave :dig! undefined. :dig with a single argument would be okay, but I have a mild preference for something more explicit, which is why I extended the original suggestion of using :dig!. ...Marvin -- 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
