How to search in digraphs?

classic Classic list List threaded Threaded
39 messages Options
12
Reply | Threaded
Open this post in threaded view
|

How to search in digraphs?

Peng Yu
Hi,

I have a hard time to find the symbol that I need in :diagraph. Is
there a table that better organize the symbols? In particular, I want
to type in $\times$. Could anybody let me know what is the shortcut?

Regards,
Peng

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Taylor Hedberg
Peng Yu, Tue 2012-04-10 @ 12:41:02-0700:
> I have a hard time to find the symbol that I need in :diagraph. Is
> there a table that better organize the symbols? In particular, I want
> to type in $\times$. Could anybody let me know what is the shortcut?

I usually use `:help digraph-table` and then search within the help
buffer with /.

attachment0 (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Taylor Hedberg
Taylor Hedberg, Tue 2012-04-10 @ 15:52:07-0400:
> Peng Yu, Tue 2012-04-10 @ 12:41:02-0700:
> > I have a hard time to find the symbol that I need in :diagraph. Is
> > there a table that better organize the symbols? In particular, I want
> > to type in $\times$. Could anybody let me know what is the shortcut?
>
> I usually use `:help digraph-table` and then search within the help
> buffer with /.

Forgot to add, the digraph for the multiplication symbol ('×') is `*X`, or
for a middle dot ('·'), it's `.M`.

attachment0 (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Charles Campbell
In reply to this post by Peng Yu
Peng Yu wrote:
> Hi,
>
> I have a hard time to find the symbol that I need in :diagraph. Is
> there a table that better organize the symbols? In particular, I want
> to type in $\times$. Could anybody let me know what is the shortcut?
>    
Hello!

Are you trying to use math? My math plugin makes such symbols available via

keymap
menu
operator

The "operator" method sets up several visual maps; one may convert 2 to
² or ₂
by visually selecting the "2" and pressing ^ or _, respectively. a to α
with visual selection and pressing & .

You may get it at:

http://www.drchip.org/astronaut/vim/index.html#MATH

Regards,
Chip Campbell

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Chris Jones-44
In reply to this post by Peng Yu
On Tue, Apr 10, 2012 at 03:41:02PM EDT, Peng Yu wrote:
> Hi,

> I have a hard time to find the symbol that I need in :diagraph. Is
> there a table that better organize the symbols? In particular, I want
> to type in $\times$. Could anybody let me know what is the shortcut?

RFC1345 is another option, with better coverage than Vim's digraph-table.

CJ

--
ALL YOUR BASE ARE BELONG TO US!

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Christian Brabandt
In reply to this post by Peng Yu
On Tue, April 10, 2012 21:41, Peng Yu wrote:
> I have a hard time to find the symbol that I need in :diagraph. Is
> there a table that better organize the symbols? In particular, I want
> to type in $\times$. Could anybody let me know what is the shortcut?

I usually use either digraph.txt or
http://www.vim.org/scripts/script.php?script_id=2822

regards,
Christian

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Boyko Bantchev
In reply to this post by Peng Yu
> I have a hard time to find the symbol that I need in :diagraph. Is
> there a table that better organize the symbols? In particular, I want
> to type in $\times$. Could anybody let me know what is the shortcut?

rfc1345 is worth checking at times, but its digraph set is different
from Vim's, and that document does not display the characters
themselves.

digraph.txt or, more specifically, :help digraph-table only show part
of the available digraphs (less than a half, I think).

I don't know of a best option than using the :digraphs command.
You can find there all available digraphs, and it is immediately seen
which of the respective characters are correctly displayed on your
system.  For more convenient browsing of the table, redirect the
output of :digraphs and read it in Vim as normal text.

Specifically for typing × I use the /\ digraph.

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Christian Brabandt
Hi Boyko!

On Mi, 11 Apr 2012, Boyko Bantchev wrote:

> > I have a hard time to find the symbol that I need in :diagraph. Is
> > there a table that better organize the symbols? In particular, I want
> > to type in $\times$. Could anybody let me know what is the shortcut?
>
> rfc1345 is worth checking at times, but its digraph set is different
> from Vim's, and that document does not display the characters
> themselves.
>
> digraph.txt or, more specifically, :help digraph-table only show part
> of the available digraphs (less than a half, I think).
>
> I don't know of a best option than using the :digraphs command.
> You can find there all available digraphs, and it is immediately seen
> which of the respective characters are correctly displayed on your
> system.  For more convenient browsing of the table, redirect the
> output of :digraphs and read it in Vim as normal text.
>
> Specifically for typing × I use the /\ digraph.
 
That is not true. Since 7.3.116 digraph.txt contains all digraphs
available.

regards,
Christian
--
Der Mensch ist bereit, für jede Idee zu sterben, vorausgesetzt, daß
ihm die Idee nicht ganz klar ist.
                -- Gilbert Keith Chesterton

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Chris Jones-44
In reply to this post by Boyko Bantchev
On Wed, Apr 11, 2012 at 02:26:03PM EDT, Boyko Bantchev wrote:

> > I have a hard time to find the symbol that I need in :diagraph. Is
> > there a table that better organize the symbols? In particular, I want
> > to type in $\times$. Could anybody let me know what is the shortcut?
>
> rfc1345 is worth checking at times, but its digraph set is different
> from Vim's,

In Vim 7.2's help:

:h digraphs-default

| ‘These default digraphs are taken from the RFC1345 mnemonics
| [...] Exception: RFC1345 doesn't specify the euro sign.’

And the way things are going, that ‘euro exception’ shouldn't be
relevant for much longer anyway.. :-)

Of course there are ‘variable length’ mnemonics (trigraphs mostly) in
rfc1345 that are not supported by Vim, but in my experience the digraphs
are exactly the same.

I guess you could write a script to compare the output of the :digraphs
command with the table in rfc1345.

> and that document does not display the characters themselves.

Well.. if you don't know the digraph, it's not going to be possible to
search for it anyway.. It makes more sense to do a search on the ISO
10646 long descriptive name (3rd column of rfc1345). e.g. you need an
arrow and you do a ‘/arrow’.. a star symbol.. ‘/star’ etc.

If you need to see the glyphs, for instance to check that it's covered
by your font, it's not too hard to do a lookup of the hex code points in
column 2 of the rfc1345 table and generate an extra glyph/char column.

> digraph.txt or, more specifically, :help digraph-table only show part
> of the available digraphs (less than a half, I think).

About 10%. It only covers the 00-FF range.

> I don't know of a best option than using the :digraphs command. You
> can find there all available digraphs, and it is immediately seen
> which of the respective characters are correctly displayed on your
> system.  For more convenient browsing of the table, redirect the
> output of :digraphs and read it in Vim as normal text.

I was getting cross-eyed trying to find what I was looking for in the
output of the :digraphs command, so I converted rfc1345 to a local vim
help file and added the correponding glyphs via a five-line script that
looked them up in the python ‘unicodedata’ module.

If you have any use for it, drop me a line off-list and I'll send you
a copy.¹

CJ

¹ Come to think of it, s/o who's familiar with Vim developement might
  use it as the basis of a patch that would provide a digraph-table in
  sync' with the ouput of the ‘:digraphs’ command on unicode-capable
  systems.

--
Oh My God!!! Larry is back!

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Chris Jones-44
In reply to this post by Christian Brabandt
On Wed, Apr 11, 2012 at 04:00:27PM EDT, Christian Brabandt wrote:
> Hi Boyko!
>
> On Mi, 11 Apr 2012, Boyko Bantchev wrote:

[..]

> > digraph.txt or, more specifically, :help digraph-table only show part
> > of the available digraphs (less than a half, I think).

[..]

> That is not true. Since 7.3.116 digraph.txt contains all digraphs
> available.

Hehe.. now everyone knows I (among others) am not current..

Now I can trash my local rfc1345 vim page..

CJ
--
HOW ARE YOU GENTLEMEN?

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Chris Jones-44
In reply to this post by Christian Brabandt
On Wed, Apr 11, 2012 at 04:00:27PM EDT, Christian Brabandt wrote:

[..]

> That is not true. Since 7.3.116 digraph.txt contains all digraphs
> available.

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..

Depending on screen size, in a UTF-8 locale I may have to hit the space
bar three or four times to reach the end of the listing and if I hit it
once too many, I have to start over.

CJ

--

Hi! My name is bobby...

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Boyko Bantchev
In reply to this post by Christian Brabandt
> That is not true. Since 7.3.116 digraph.txt contains all digraphs available.

Nice to know that, but it seems a very recent addition.
I happen to be using several versions of Vim, the most recent being 7.3.46,
and none of them has all the chars in digraph.txt.
So, perhaps we should say, `That *is* true, unless you compiled Vim
yourself from the most recent sources.'  :)

In fact, even in its most recent version, digraph.txt is missing some digraphs.
I just searched for the digraph /\ (for ×), and it is not in
http://code.google.com/p/vim/source/browse/runtime/doc/digraph.txt .

> | ‘These default digraphs are taken from the RFC1345 mnemonics
> | [...] Exception: RFC1345 doesn't specify the euro sign.’

The Euro sign is not the only difference between rfc1345 and the
output of :digraphs.  I cannot tell what all of them are, but, e.g.,
the already mentioned /\ is known to Vim but is not in the rfc.
Perhaps, as well, Vim misses some definitions that the rfc has.

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Christian Brabandt
On Thu, April 12, 2012 08:13, Boyko Bantchev wrote:
>> That is not true. Since 7.3.116 digraph.txt contains all digraphs
>> available.
>
> Nice to know that, but it seems a very recent addition.

If I recall correctly, it's more than a year ago, that I provided the
patch:
http://groups.google.com/group/vim_dev/msg/1eeb0d49255204d1

> I happen to be using several versions of Vim, the most recent being
> 7.3.46,
> and none of them has all the chars in digraph.txt.
> So, perhaps we should say, `That *is* true, unless you compiled Vim
> yourself from the most recent sources.'  :)

I wouldn't call that recent anymore ;)

> In fact, even in its most recent version, digraph.txt is missing some
> digraphs.
> I just searched for the digraph /\ (for ×), and it is not in
> http://code.google.com/p/vim/source/browse/runtime/doc/digraph.txt .

Search for the hex code d7 and you'll find it.
It seems like the Multiplication sign uses /\ and *X as digraph
while only *X is documented. I don't know, how many more digraphs have
several different chars to enter it (which are not documented).

I found it by using my plugin that I already mentioned before.

>> | ‘These default digraphs are taken from the RFC1345 mnemonics
>> | [...] Exception: RFC1345 doesn't specify the euro sign.’
>
> The Euro sign is not the only difference between rfc1345 and the
> output of :digraphs.  I cannot tell what all of them are, but, e.g.,
> the already mentioned /\ is known to Vim but is not in the rfc.
> Perhaps, as well, Vim misses some definitions that the rfc has.

Would be good to know, what else is missing, so one could add to the
documentation.

regards,
Christian

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Christian Brabandt
On Thu, April 12, 2012 08:30, Christian Brabandt wrote:
> On Thu, April 12, 2012 08:13, Boyko Bantchev wrote:
>> The Euro sign is not the only difference between rfc1345 and the
>> output of :digraphs.  I cannot tell what all of them are, but, e.g.,
>> the already mentioned /\ is known to Vim but is not in the rfc.
>> Perhaps, as well, Vim misses some definitions that the rfc has.
>
> Would be good to know, what else is missing, so one could add to the
> documentation.

I looked it up in the source. The /\ is an old digraph, which was defined
with Vim 5 and back then digraphs did not correspond to the RFC.
Starting with Vim 6, digraphs correspond to RFC1345, but Vim still
supports the old digraphs, if they are unambigous to RFC1345.

This is mentioned briefly at :h digraphs-changed

regards,
Christian

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Dominique Pellé
In reply to this post by Chris Jones-44
Chris Jones wrote:

> Depending on screen size, in a UTF-8 locale I may have to hit the space
> bar three or four times to reach the end of the listing and if I hit it
> once too many, I have to start over.

When you see the -- More -- prompt after typing :dig, you can press  f
instead of <Space> to move forward by page (and  b  to move backward).
Unlike <Space>, you don't have to start over when you reach the end
when pressing  f.

See also :help more-prompt

Regards
-- Dominique

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Chris Jones-44
In reply to this post by Boyko Bantchev
On Thu, Apr 12, 2012 at 02:13:32AM EDT, Boyko Bantchev wrote:

> The Euro sign is not the only difference between rfc1345 and the
> output of :digraphs.  

It's the only exception listed in the documentation.

> I cannot tell what all of them are, but, e.g., the already mentioned
> /\ is known to Vim but is not in the rfc. Perhaps, as well, Vim misses
> some definitions that the rfc has.

The standard mnemonic for ‘×’ is ‘*X’. I have no idea where the ‘/\’
came into the picture, but it looks like some non-standard Vim-ism that
may be there for historical reasons. After all when you run the :dig
command, it's listed with a bunch of others out of code point sequence
right near the end of the listing while the ‘*X’ rfc1345 mnemonic is
listed near the beginning where it belongs, between code point ‘214’ and
‘216’. Seems to be the same for the other mnemonics that appear right at
the end of the listing such as ‘11’ -> ‘¹’...‘22’ -> ‘²’...

My guess is that they predate the RFC (or rather the integration of the
RFC's mnemonics to Vim) and were kept as aliases so that users who had
grown accustomed to them wouldn't have to add them back manually.

CJ

--
Oh My God!!! Larry is back!

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

RE: How to search in digraphs?

JohnBeckett
In reply to this post by Christian Brabandt
I needed to look at ':help digraph-table' and noticed
something strange. There are 22 lines that have <space><grave>
at the end, for example:

- -N 2013 8211 EN DASH `

However, the grave is hidden in the help.

Is there a reason for the grave, or is it a documentation glitch?

John

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

RE: How to search in digraphs?

Christian Brabandt
On Thu, April 12, 2012 09:37, John Beckett wrote:
[forwarding to vim-dev]
> I needed to look at ':help digraph-table' and noticed
> something strange. There are 22 lines that have <space><grave>
> at the end, for example:
>
> - -N 2013 8211 EN DASH `
>
> However, the grave is hidden in the help.
>
> Is there a reason for the grave, or is it a documentation glitch?

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

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Dominique Pellé
In reply to this post by JohnBeckett
John Beckett <[hidden email]> wrote:

> I needed to look at ':help digraph-table' and noticed
> something strange. There are 22 lines that have <space><grave>
> at the end, for example:
>
> -       -N      2013    8211    EN DASH `
>
> However, the grave is hidden in the help.
>
> Is there a reason for the grave, or is it a documentation glitch?
>
> John


I think that's perhaps intended.  If I remove the trailing grave in...

Ń       N'      0143    0323    LATIN CAPITAL LETTER N WITH ACUTE `

... then the N letter becomes highlighted (with helpSpecial syntax group).
With the trailing `, the whole line has helpGraphic syntax group.

However, the trailing ` is not used consistently. For example, it does
not appear in...

ñ       n?      0xf1    241     LATIN SMALL LETTER N WITH TILDE

... where the N letter is highlighted.

I suppose that the trailing ` should be added to every lines in the
digraph table.

I also did not see any documentation for the trailing ` anywhere.
I think it should be described in ":help help-writing".

-- Dominique

--
You received this message from the "vim_use" 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
Reply | Threaded
Open this post in threaded view
|

Re: How to search in digraphs?

Boyko Bantchev
In reply to this post by Christian Brabandt
On 12 April 2012 09:30, Christian Brabandt <[hidden email]> wrote:
> If I recall correctly, it's more than a year ago, that I provided the
> patch:
> .........
> I wouldn't call that recent anymore ;)

Your version of digraph.txt is not in the compiled versions of Vim
distributed from vim.org.  It is not even in the source packages for
those who would compile Vim themselves.

So long as it is not in the current Vim distributions, this version
of digraph.txt is by no means representative of Vim.  It is still
ineffective.  Had you not mentioned it, I wouldn't even know it
existed.  How would I?

Now, I did not intend to make a big deal of all this, but saying that
digraph.txt contains all digraph definitions, as was the case, is
simply misleading, because it appears to not be true for almost all
users of Vim.

>> In fact, even in its most recent version, digraph.txt is missing some
>> digraphs.
>> I just searched for the digraph /\ (for ×), and it is not in
>> http://code.google.com/p/vim/source/browse/runtime/doc/digraph.txt .
>
> Search for the hex code d7 and you'll find it.

What can be found is ×, but /\, as I said, is missing.  Also missing
are c|, cO, n~, etc. – perhaps all those at the end of :digraph's
output.  As long as they are effective in Vim, it is worth listing
them, too, in digraph.txt (under 'legacy' or whatever).

Regards,
  Boyko

--
You received this message from the "vim_use" 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
12