That is probably a documentation glitch. I bet, the space grave
should be there at every entry, since this is used for syntax highlighting
help files (helpGraphics I think).
Additionally helpGraphic should also link to something so it
is highlighted in the help file, maybe Macro?
regards,
Christian
On Mi, 11 Apr 2012, Chris Jones wrote:
> Is there a format of the ‘:digraphs’ command that lets you list only
> custom user-defined digraphs - i.e. those that are different from the
> defaults..?
>
> Couldn't find such a thing in Vim 7.2..
>
> If there isn't, something like ‘:dig!’ would be nice..
Here is a patch, that makes :dig! display only user-defined digraphs and
:dig! xy remove the digraph, that is defined by the chars xy
This sounds like a useful addition.
regards,
Christian
Not sure if/when I'll be able to test it since I'm on debian and I don't
have a vim source environment set up.
Shouldn't there be a patch against the digraph.txt help file as well..
or does that work differently..?
CJ
--
SOMEBODY SET UP US THE BOMB
If ":dig! xy" deletes a digraph I would expect ":dig!" to delete all
user-defined digraphs. Thus have "!" mean delete.
Can we use another command to list user-defined digraphs? Perhaps
":dig ?"?
This patch would also need documentation. And a test would be good too.
--
`When any government, or any church for that matter, undertakes to say to
its subjects, "This you may not read, this you must not see, this you are
forbidden to know," the end result is tyranny and oppression no matter how
holy the motives' -- Robert A Heinlein, "If this goes on --"
/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
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. I would even go so far as to allow :dig!
{char} to find all digraphs with the specified char in either position.
If char is ambiguous (i.e. a single digit or two digits) treat is as
both {char} or {char}{char} and {number} (list all matches).
While :dig! without arguments would list user-defined digraphs, :dig!
with an argument would list all matching digraphs, both pre-defined and
user-defined.
...Marvin
> * Bram Moolenaar <Br...@Moolenaar.net> [120413 05:42]:
>> Christian Brabandt wrote:
>>> Here is a patch, that makes :dig! display only user-defined digraphs
>>> and :dig! xy remove the digraph, that is defined by the chars xy
>>>
>>> This sounds like a useful addition.
>>
>> If ":dig! xy" deletes a digraph I would expect ":dig!" to delete all
>> user-defined digraphs. Thus have "!" mean delete.
>>
>> Can we use another command to list user-defined digraphs? Perhaps
>> ":dig ?"?
>>
>> This patch would also need documentation. And a test would be good too.
>
> 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}
(The parallels with :au):
" lack of {cmd} means list (optionally limited to a group)
:au [group] " list all autocmds
:au [group] {event} " list all autocmds for event
:au [group] * {pat} " list autocmds for all events, w/pattern
:au [group] {event} {pat} " list autocmds for given event and pattern
" specifying {cmd} means definition (with optional 'nested' flag)
:au [group] {event} {pat} [nested] {cmd} " define an autocmd
" ! means delete (optionally limited to a group)
:au! [group] " delete all autocmds
:au! [group] {event} " delete all autocmds for event
:au! [group] * {pat} " delete autocmds for all events, w/pattern
:au! [group] {event} {pat} " delete autocmds for given event and pattern
" specifying {cmd} and ! means replace (delete and then define)
:au! [group] {event} {pat} [nested] {cmd}
To complete the similarities, the "user" argument could be thought of as
the digraphs' [group] (where the default group, if not specified, is
"all" when listing, and "user" when creating).
--
Best,
Ben
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
On Fr, 13 Apr 2012, Bram Moolenaar wrote:
> Can we use another command to list user-defined digraphs? Perhaps
> ":dig ?"?
>
> This patch would also need documentation. And a test would be good too.
Updated patch.
The patch introduces the following changes:
1) :dig? print only user-defined digraphs
2) :dig? <char1>[<char2>] print an exact match, if 2 chars are given,
else print all digraphs matching char1
3) :dig? Number print digraph for decimal value Number
4) :dig! clear all user-defined digraphs
5) :dig! <char1><char2> clear user-defined digraph <char1><char2>
6) documentation update
7) including a test (test85)
regards,
Christian
Thanks for the quick update.
We don't use ? like this in any command, but somehow it feels right. Or
would there be something better?
":dig ? Number" is OK, but this looks like it only works for user
digraps. I suppose leaving out the ? has the problem that it would look
like defining a digraph, although ":dig 12" currently gives an error.
So perhaps we can use that.
--
WOMAN: Well, 'ow did you become king then?
ARTHUR: The Lady of the Lake, [angels sing] her arm clad in the purest
shimmering samite, held aloft Excalibur from the bosom of the water
signifying by Divine Providence that I, Arthur, was to carry
Excalibur. [singing stops] That is why I am your king!
The Quest for the Holy Grail (Monty Python)
> Is there any current Vim command that uses "!" to indicate that things
> will be listed? If not, this seems even more inconsistent.
:files, (a.k.a. :buffers, a.k.a. :ls)
--
Erik Falor http://unnovative.net
Registered Linux User #445632 http://linuxcounter.net