<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dw="https://www.dreamwidth.org">
  <id>tag:dreamwidth.org,2009-09-15:446148</id>
  <title>shadowspar</title>
  <subtitle>open sky / shooting star / nothing else but who we are</subtitle>
  <author>
    <name>shadowspar</name>
  </author>
  <link rel="alternate" type="text/html" href="https://shadowspar.dreamwidth.org/"/>
  <link rel="self" type="text/xml" href="https://shadowspar.dreamwidth.org/data/atom"/>
  <updated>2011-11-11T19:27:29Z</updated>
  <dw:journal username="shadowspar" type="personal"/>
  <entry>
    <id>tag:dreamwidth.org,2009-09-15:446148:64730</id>
    <link rel="alternate" type="text/html" href="https://shadowspar.dreamwidth.org/64730.html"/>
    <link rel="self" type="text/xml" href="https://shadowspar.dreamwidth.org/data/atom/?itemid=64730"/>
    <title>vim digraphs: ♥</title>
    <published>2011-11-11T19:23:47Z</published>
    <updated>2011-11-11T19:27:29Z</updated>
    <category term="vim"/>
    <category term="geek"/>
    <category term="i18n"/>
    <dw:mood>okay</dw:mood>
    <dw:security>public</dw:security>
    <dw:reply-count>15</dw:reply-count>
    <content type="html">&lt;p&gt;
First thing.  For those who use vim but might not have known about it:
vim has a feature called &lt;em&gt;digraphs&lt;/em&gt; which gives you a way to
enter letters with diacritics (eg ä), symbols (eg ✓), and other 
characters that aren't on your keyboard.  It does have its 
idiosyncracies, but it's fairly reasonable once you start to 
toy with it a bit. 
&lt;/p&gt;
&lt;p&gt;
How it works: first, enter the &lt;em&gt;compose key&lt;/em&gt;, which by default
is Control-K.  Then enter the two characters of the digraph, and you'll
get the single character that's defined in the digraphs table for that 
particular combination.
&lt;/p&gt;
&lt;p&gt;
So, for instance:
&lt;/p&gt;


&lt;ul&gt;
    &lt;li&gt;&lt;em&gt;Ctrl-K&lt;/em&gt; + &lt;strong&gt;o&lt;/strong&gt;  + &lt;strong&gt;-&lt;/strong&gt; ⇒ &lt;strong&gt;ō&lt;/strong&gt; &lt;/li&gt;
    &lt;li&gt;&lt;em&gt;Ctrl-K&lt;/em&gt; + &lt;strong&gt;e&lt;/strong&gt;  + &lt;strong&gt;:&lt;/strong&gt; ⇒ &lt;strong&gt;ë&lt;/strong&gt; &lt;/li&gt;
    &lt;li&gt;&lt;em&gt;Ctrl-K&lt;/em&gt; + &lt;strong&gt;c&lt;/strong&gt;  + &lt;strong&gt;,&lt;/strong&gt; ⇒ &lt;strong&gt;ç&lt;/strong&gt; &lt;/li&gt;
    &lt;li&gt;&lt;em&gt;Ctrl-K&lt;/em&gt; + &lt;strong&gt;o&lt;/strong&gt;  + &lt;strong&gt;C&lt;/strong&gt; ⇒ &lt;strong&gt;℃&lt;/strong&gt; &lt;/li&gt;
    &lt;li&gt;&lt;em&gt;Ctrl-K&lt;/em&gt; + &lt;strong&gt;P&lt;/strong&gt;  + &lt;strong&gt;d&lt;/strong&gt; ⇒ &lt;strong&gt;£&lt;/strong&gt; &lt;/li&gt;
    &lt;li&gt;&lt;em&gt;Ctrl-K&lt;/em&gt; + &lt;strong&gt;1&lt;/strong&gt;  + &lt;strong&gt;2&lt;/strong&gt; ⇒ &lt;strong&gt;½&lt;/strong&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;
The command &lt;tt&gt;:digraphs&lt;/tt&gt; will show you everything in the
digraphs table.
&lt;/p&gt;

&lt;p&gt;
Last thing and the point of all that preparatory context above:
there is a terrible problem with the set of digraphs as it ships with
vim.  &lt;em&gt;Clearly&lt;/em&gt; the sequence 
&lt;strong&gt;&amp;lt;&lt;/strong&gt; + &lt;strong&gt;3&lt;/strong&gt; should compose to the
character ♥, but it doesn't by default.  To remedy this horrible 
shortcoming, add the line  
&lt;/p&gt;

&lt;p&gt;
&lt;tt&gt;digraph &amp;lt;3 9829&lt;tt&gt;
&lt;/tt&gt;&lt;/tt&gt;&lt;/p&gt;

&lt;p&gt;
to your vim config file.  (9829 is the unicode decimal identifier for
the character ♥.)
&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;img src="https://www.dreamwidth.org/tools/commentcount?user=shadowspar&amp;ditemid=64730" width="30" height="12" alt="comment count unavailable" style="vertical-align: middle;"/&gt; comments</content>
  </entry>
</feed>
