Unicode completion plugin.
[profile.git] / .vim / doc / unicode.txt
1 *unicode.txt* A completion plugin for Unicode glyphs
2
3 Author:  Christian Brabandt <cb@256bit.org>
4 Version: 0.17 Thu, 15 Aug 2013 08:53:06 +0200
5                                                         *unicode-copyright*
6 Copyright: (c) 2009 - 2013 by Christian Brabandt
7            The VIM LICENSE applies to unicode.vim and unicode.txt
8            (see |copyright|) except use unicode instead of "Vim".
9            NO WARRANTY, EXPRESS OR IMPLIED.  USE AT-YOUR-OWN-RISK.
10
11 ==============================================================================
12                                                               *unicode-plugin*
13 1. Functionality
14
15 This plugin was written to enable an easier use of any Unicode glyph
16 available. The unicode.vim Plugin uses the data available from the Unicode
17 Consortium's website (http://www.unicode.org) to let you enter Unicode
18 characters using a completion function.
19
20 By default, the plugin creates a directory unicode below the path autoload
21 where this plugin is located. Within this directory it will store  the file
22 UnicodeData.txt from http://www.unicode.org/Public/UNIDATA/UnicodeData.txt
23 which it will try to download using |netrw| . If this is unsuccessfull, or
24 you do not have |netrw| enabled, dowload the file manually and save it in the
25 unicode directory below the autoload directory in which unicode.vim is
26 located.
27
28
29                                                  *:EnableUnicodeCompletion*
30 By default the plugin is not enabled. To enable it enter: >
31
32     :EnableUnicodeCompletion
33
34 When you run this command, unicode.vim checks for the availability of
35 UnicodeData.txt from the Unicode Consortium, and if it is not available,
36 it will try to download it.
37
38 This will also set up the completion function |completefunc| to use for your
39 buffer. You can use |i_CTRL-X_CTRL-U| then to start the completion.
40
41                                                  *:DisableUnicodeCompletion*
42 If you want to disable the plugin, enter >
43
44     :DisableUnicodeCompletion
45 <
46                                                             *:UnicodeName*
47 Suppose, you want to know, what the Unicode Name for the Character under the
48 cursor is. You simply enter the ex command: >
49
50     :UnicodeName [reg]
51
52 The plugin will then output the character, the character's hexadecimal value
53 and the official Unicode name.
54
55 Additionally, if there exists a digraph for that character, it will also be
56 shown in paranthesis.
57
58 If you specify a register name, the message will also be saved into that
59 register.
60
61                                                                     *:Digraphs*
62 >
63     :Digraphs
64
65 Outputs the digraph list in an easier way to read with coloring of the digraphs.
66
67 If you want to display a list with a line break after each digraph, use the
68 bang attribute >
69
70     :Digraphs!
71
72 And if you want to display all digraphs matching a certain value, you can add
73 an argument to the command: >
74
75     :Digraphs! A
76
77 displays all digraphs, that match 'A' (e.g. all that can be created with the
78 letter A or whose digraph matches the letter 'A'.
79
80 ==============================================================================
81                                                     *unicode-plugin-usage*
82 2. Completing Unicode chars
83
84 If you have enabled the plugin using |:EnableUnicodeCompletion| then there are
85 2 possibilities to use the plugin. You can either enter the Unicode Character
86 name, or enter the Unicode-Codeposition.
87
88 For example, you would like to enter Æ, so you enter AE and press |<C-X><C-U>|
89 while in insert mode. Alternatively you can enter the Unicode-Codepoint: U+C6
90 and press |<C-X><C-U>| and the popup menu will show you all characters, that
91 have a codepoint like C6 with leading zeros, eg. U+00C6 and U+0C66
92
93 A popup menu will appear, showing you the Unicode-Codeposition value, the
94 Unicode Character Name and the Unicode Character (and if you have enabled it,
95 it can also show you the digraph characters needed to create this character in
96 paranthesis, see |unicode-plugin-config| ). You can scroll down in the menu by
97 pressing <C-N> and up by pressing <C-P>.
98
99 A |preview-window| can be opened, if your Vim was compiled with the
100 quickfix-feature that displays the hexadecimal Unicode Codepoint, the name,
101 the digraph characters in parenthesis (if they exist) followed by the glyph
102 itself by setting the variable g:UnicodeShowPreviewWindow (see below). By
103 default, this feature is off.
104
105                                                     *unicode-plugin-config*
106 The plugin can be customized to include the 2 digraph characters you have to
107 type, to get that character. This works only, if there is a digraph defined
108 for that Unicode char. If you would like this you need to set
109 g:showDigraphCode, e.g. >
110
111     :let g:showDigraphCode=1
112
113 This functionality is by default disabled, cause it seems to cause some delay
114 and screen-rendering errors in the menu. However, the preview window will
115 always show the digraph character in parenthesis.
116 Enter >
117
118     :let g:showDigraphCode=0
119
120 to disable the Digraph feature afterwards.
121
122 If you would like to specify a different URL from which to download
123 UnicodeData.txt, enter the URL as: >
124
125     :let g:unicode_URL='http:....'
126
127 To force downloading the file from that new url, enter >
128
129     :call unicode#CheckUniFile(1)
130
131 If you'd like Unicode completion to be always enabled, you can set the
132 variable g:enableUnicodeCompletion to 1 in your |.vimrc| like this: >
133
134      let g:enableUnicodeCompletion = 1
135 <
136 Thus, you won't need to use EnableUnicodeCompletion, it will be already
137 available.
138
139 If you only want to complete the Unicode Names instead of the glyphs,
140 you can either set the global variable >
141
142     let g:unicode_complete_name = 1
143 <
144 or you can use the mapping <leader>un which swaps the completion function
145 between completing the unicode name and completing the unicode glyph.
146
147 If you want the completion of the unicode chars to be opened in the preview
148 window, set the variable >
149
150     let g:UnicodeShowPreviewWindow = 1
151 <
152 in your |.vimrc|.
153
154                                                      *unicode-plugin-error*
155 If the plugin gives an error or does not complete anything, first check, that
156 UnicodeData.txt from the Unicode Consortium has been successfully downloaded.
157 It should be located below the autoload/unicode.vim script in a directory
158 called unicode. So if you have installed unicode.vim into
159 /home/user/.vim, UnicodeData.txt should be located at:
160 /home/user/.vim/autoload/unicode/UnicodeData.txt and should look like this:
161
162 0020;SPACE;Zs;0;WS;;;;;N;;;;;
163 0021;EXCLAMATION MARK;Po;0;ON;;;;;N;;;;;
164 0022;QUOTATION MARK;Po;0;ON;;;;;N;;;;;
165 0023;NUMBER SIGN;Po;0;ET;;;;;N;;;;;
166 0024;DOLLAR SIGN;Sc;0;ET;;;;;N;;;;;
167 0025;PERCENT SIGN;Po;0;ET;;;;;N;;;;;
168 0026;AMPERSAND;Po;0;ON;;;;;N;;;;;
169 0027;APOSTROPHE;Po;0;ON;;;;;N;APOSTROPHE-QUOTE;;;;
170 0028;LEFT PARENTHESIS;Ps;0;ON;;;;;Y;OPENING PARENTHESIS;;;;
171 0029;RIGHT PARENTHESIS;Pe;0;ON;;;;;Y;CLOSING PARENTHESIS;;;;
172 [...]
173 (several thounsand lines following)
174
175 If the file looks correct, and the plugin is still not working correctly
176 contact the maintainer. You'll find his email-adress in the first line of this
177 document. Please be patient, it might take a while, until I can take care of
178 your report.
179
180 ==============================================================================
181                                         *i_CTRL-X_CTRL-G* *digraph-completion*
182 3. Completing digraphs
183
184 CTRL-X CTRL-G           Search for the character in front of the cursor and
185                         try to complete this letter using a digraph. If there
186                         is no letter in front of the cursor, a list with all
187                         available digraphs is shown in a popup menu.
188                         If both letters in front of the cursor form a digraph,
189                         that digraph will be completed.
190                         (Think of Glyph)
191        CTRL-N           Use next match. This match replaces the previous
192                         match.
193        CTRL-P           Use previous match. This match replaces the previous
194                         one.
195
196
197 ==============================================================================
198 4. unicode History                                    *unicode-plugin-history*
199     0.17: Aug 15, 2013  - disable preview window (for completing unicode chars)
200                           by default, can be enabled by setting the variable
201                           g:UnicodeShowPreviewWindow (patch by Marcin
202                           Szamotulski, thanks!)
203     0.16: Feb 16, 2013  - |:UnicodeName| returns html entity, if possible
204     0.15: Feb 05, 2013  - make sure, the returned digraphs list is not empty.
205     0.14: Dec 01, 2012  - |:Digraphs| for better display of digraphs
206     0.13: Sep 08, 2012  - better output for |UnicodeName| (did previously hide
207                           messages)
208     0.12: Apr 12, 2012  - |UnicodeName| shows digraph, if it exists
209                         - better completion of digraphs
210     0.11: Apr 11, 2012  - prevent loading of autoload file too early
211                         - Make matching digraph more error-prone
212                         - show all matching digraphs for a char
213     0.10: Dec 15, 2011  - enable completing of only the names
214                         - Really disable the 'completefunc' when disabling
215                           the function
216     0.9: Jul 20, 2011:  - |:UnicodeName| checks for existence of
217                           UnicodeData.txt
218                         - |:UnicodeName| now also detects combined chars
219                         - |:UnicodeName| now also outputs control chars
220     0.8: Sep 30, 2010:  - Fix an issue with configuring the plugin (Thanks jgm)
221                         - Code cleanup
222                         - Make use of the preview window, when completing
223                           Digraph or Unicode Glyphs
224                         - By default, the Digraph Glyphs will now be enabled
225                           using |i_Ctrl-X_CTRL-G| instead of using
226                           Ctrl-X_Ctrl-C which wouldn't work in a terminal
227                         - |:UnicodeName| now displays the hexadecimal Unicode
228                           Codepoint instead of the decimal one (as this seems
229                           to be the official way to display unicode
230                           codepoints).
231     0.7: Sep 23, 2010:  - |:UnicodeName|
232                         - specify g:enableUnicodeCompletion to have unicode
233                           completion always enabled.
234     0.6: Aug 26, 2010:  - many small bugfixes with regard to error-handling
235                           and error displaying
236                         - use default netrw_http_cmd (instead of hardwiring
237                           wget)
238                         - small documentation update (Inlude a snippet of
239                           UnicodeData.txt and get rid of Index.txt data)
240     0.5: Apr 19, 2010:  Created a public repository for this plugin at
241                             http://github.com/chrisbra/unicode.vim
242     0.4: Feb 01, 2010:  Use UnicodeData.txt to generate Data
243                         (Index.txt does not contain all glyphs).
244                         Check for empty file UnicodeData.txt
245     0.3: Oct 27, 2009:  Digraph Completion
246     0.2: Oct 22, 2009:  Enabled GetLatestScripts (|GLVS|)
247     0.1: Oct 22, 2009:  First working version
248
249 ==============================================================================
250 vim:tw=78:ts=8:ft=help