@@ -20,12 +20,12 @@ License: MIT license {{{
2020 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
2121 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
2222}}}
23-
2423CONTENTS *julia-vim-L2U*
2524
2625LaTeX-to-Unicode substitutions | julia-vim-L2U-introdction |
2726 Via Tab key | julia-vim-L2U-tab |
2827 As you type | julia-vim-L2U-as-you-type |
28+ Via Keymap | julia-vim-L2U-keymap |
2929 On different file types | julia-vim-L2U-file-types |
3030 Enabling and disabling | julia-vim-L2U-enable-disable |
3131Variables | julia-vim-L2U-variables |
@@ -34,38 +34,54 @@ Functions |julia-vim-L2U-functions|
3434==============================================================================
3535LATEX TO UNICODE *julia-vim-L2U-introduction*
3636
37- In the Julia REPL, entering a LaTeX sequence such as `\a lpha` and pressing the
38- <Tab> key substitutes it with a Unicode character such as `α` . The Julia REPL
39- also provides partial completions, and suggestions for possible completions
40- upon repeated pressing of the <Tab> key. Emojis are also available, with
41- their names written between colons, e.g. `\: interrobang: ` produces `⁉` .
42-
43- This Vim plug-in provides the same functionality, with some extensions:
44- - when a partial sequence is found, suggestions are presented in a menu
45- together with their Unicode counterpart; the exact behaviour of this
46- feature can be customized, see | julia-vim-L2U-tab |
47- - optionally, symbols are substituted on the fly as you type them, see
48- | julia-vim-L2U-as-you-type |
49-
50- In Vim | Command-line | mode, e.g. when searching with the | / | or | ? | commands, the
51- default behavior is very similar, but slightly more limited: there are no
52- suggestions, and the as-you-type substitutions are not avaliable. By default
53- both <Tab> and <S-Tab> are mapped in command-line mode (the latter for
54- backward compatibility reasons), but this can be customized if needed, see
55- | julia-vim-L2U-cmdmode | .
37+ In the Julia REPL, entering a LaTeX-like sequence such as `\a lpha` and pressing
38+ the <Tab> key substitutes it with a Unicode character such as `α` . The Julia
39+ REPL also provides partial completions, and suggestions for possible
40+ completions upon repeated pressing of the <Tab> key. Emojis are also
41+ available, with their names written between colons, e.g. `\: interrobang: `
42+ produces `⁉` .
43+
44+ See | julia-vim-L2U-reference | for the complete table of substitutions.
45+
46+ This Vim plug-in also provides the functionality needed to convert LaTeX
47+ input sequences into Unicode characters. There are 3 different methods
48+ available:
49+
50+ 1. The default one is the most similar to the Julia one: substitutions are
51+ triggered by pressing the <Tab> key; if a partial match is found a list
52+ of suggested completions is presented in a menu together with their
53+ Unicode counterpart. The exact behaviour of this feature can be
54+ customized, see | julia-vim-L2U-tab | .
55+
56+ 2. The second one substitutes symbols on the fly as you type, but only in
57+ | Insert | mode. See | julia-vim-L2U-as-you-type | .
5658
57- By default, this feature is only active when editing Julia files. However, it
58- can be also enabled with other file types, see | julia-vim-L2U-file-types | , and
59- even turned on/off on the fly regardless of the file type, see
60- | julia-vim-L2U-enable-disable | .
59+ 3. The third is based on | keymap | . It also substitutes as-you-type, but it
60+ doesn't show you the full LaTeX sequence as you're typing it, and there
61+ is a time-out. Its main advantage over the previous one is that can be
62+ used in more circumstances, e.g. in | Command-line | mode or when searching
63+ for a character with | f | or | t | , as explained in | language-mapping | . See
64+ | julia-vim-L2U-keymap | .
65+
66+ The first two methods are independent and can be used together without issues.
67+ The third one is best used by its own, disabling the other two, to avoid
68+ confusion.
69+
70+ The default configuration is to use the first method, and it's only active
71+ when editing Julia files. It only works in | Insert | and | Command-line | modes.
72+
73+ It is possible to enable it with other file types, see
74+ | julia-vim-L2U-file-types | , and it can be even turned on/off on the fly
75+ regardless of the file type, see | julia-vim-L2U-enable-disable | .
76+
77+ In | Command-line | mode, e.g. when searching with the | / | or | ? | commands, the
78+ default behavior is very similar, but slightly more limited, see
79+ | julia-vim-L2U-cmdmode | .
6180
6281These features only work as described with Vim version 7.4 or higher. Tab
6382completion can still be made available on lower Vim versions, see
6483| julia-vim-L2U-workaround | .
6584
66- See | julia-vim-L2U-reference | for the complete table of the available
67- LaTeX-to-Unicode substitutions.
68-
6985See | julia-vim | for the general reference about the other features of the
7086julia-vim plug-in.
7187
@@ -82,7 +98,7 @@ mapping assigned to it, such that when the <Tab> key is pressed the plug-in
8298looks for potential LaTeX symbol matches before the cursor, and if it fails to
8399find anything of interest it will fall-back to the previous mapping for <Tab>
84100(with default Vim settings, this means it will insert a literal <Tab> ; but if
85- you have defined dome other behaviour for that key, e.g. by installing another
101+ you have defined some other behavior for that key, e.g. by installing another
86102plug-in such as supertab (https://github.com/ervandew/supertab ) than that will
87103be used).
88104
@@ -128,13 +144,13 @@ setting.
128144
129145Command-line mode *julia-vim-L2U-cmdmode*
130146
131- In | Command-line | mode, the behavior is largely the same except that both <Tab> and
132- <S-Tab> are mapped by default, and the functionality is slightly more limited.
133- No suggestions are shown for partial completions. Pre-existsing user-defined
134- mappings of <Tab> are overridden, and in case of no L2U matches the fallback
135- behavior is the standard Vim one. In order to avoid that, the
147+ In | Command-line | mode, the behavior is largely the same except that both
148+ <Tab> and <S-Tab> are mapped by default, and the functionality is slightly
149+ more limited. No suggestions are shown for partial completions. Pre-existing
150+ user-defined mappings of <Tab> are overridden. In order to avoid that, the
136151completion can be mapped onto a defferent key combination, see
137- | g:latex_to_unicode_cmd_mapping | .
152+ | g:latex_to_unicode_cmd_mapping | . When using <Tab> , if no matches are found
153+ the behavior falls back to the standard Vim command-line completion.
138154
139155Vim versions lower than 7.4 *julia-vim-L2U-workaround*
140156
@@ -174,6 +190,25 @@ This feature does not currently work with emojis.
174190
175191This feature does not interfere with the <Tab> based substitution.
176192
193+ ------------------------------------------------------------------------------
194+ LATEX TO UNICODE VIA KEYMAP *julia-vim-L2U-keymap*
195+
196+ This method is somewhat similar to the as-you-type one described above, but it
197+ uses | keymap | to generate the mappings. This has the advantage that it works
198+ in more circumstances, e.g. in | Command-line | mode or when searching within a
199+ line with | f | or | t | (since it uses | language-mapping | underneath). It can
200+ also be easily turned on or off like any other keymap (see | i_CTRL-^ | and
201+ | c_CTRL-^ | ).
202+ The disadvantages are that you don't see the whole sequence as you're typing
203+ it, and no suggestions or partial completions are available, thus you need to
204+ know the substitutions (see | julia-vim-L2U-reference | ), and to type them
205+ correctly in full.
206+ Another difference is that there is a | timeout | like for any other mapping.
207+
208+ In order to use this method, set | g:latex_to_unicode_keymap | to `1 ` .
209+ If you do so, it is advisable to disable the other two methods,
210+ setting both | g:latex_to_unicode_tab | and | g:latex_to_unicode_auto | to `0 ` .
211+
177212------------------------------------------------------------------------------
178213LATEX TO UNICODE ON DIFFERENT FILE TYPES *julia-vim-L2U-file-types*
179214
@@ -271,15 +306,15 @@ g:latex_to_unicode_eager
271306 pressing <Tab> again performs the substitution.
272307
273308 This variable can be set at any time, changes will immediately
274- take effect. When | g:latex_to_unicode_suggestions | is 0 ,
309+ take effect. When | g:latex_to_unicode_suggestions | is ` 0 ` ,
275310 this setting has no effect (it's like if it was always on).
276311
277312 *g:latex_to_unicode_auto*
278313g:latex_to_unicode_auto
279314
280315 Determines whether to activate LaTeX-to-Unicode substitution
281316 on the fly as you type (in | Insert | mode), see
282- | julia-vim-L2U-as-you-type | . If unspecified, it is 0 (off).
317+ | julia-vim-L2U-as-you-type | . If unspecified, it is ` 0 ` (off).
283318 You can enable the feature by default by inserting the line
284319>
285320 let g:latex_to_unicode_auto = 1
@@ -288,6 +323,23 @@ g:latex_to_unicode_auto
288323 moment while editing, but you need to invoke
289324 | LaTeXtoUnicode#Init() | for the change to take effect.
290325
326+
327+ *g:latex_to_unicode_keymap*
328+ g:latex_to_unicode_keymap
329+
330+ Determines whether to activate the | keymap | -based
331+ LaTeX-to-Unicode substitutions, see | julia-vim-L2U-keymap | .
332+ If unspecified, it is `0 ` (off). You can enable the feature by
333+ default by inserting the line
334+ >
335+ let g:latex_to_unicode_keymap = 1
336+ <
337+ in your | .vimrc | file. You can change this setting at any
338+ moment while editing, but you need to invoke
339+ | LaTeXtoUnicode#Init() | for the change to take effect.
340+ It's advisable to disable | g:latex_to_unicode_tab | and
341+ | g:latex_to_unicde_auto | if you use this.
342+
291343 *g:latex_to_unicode_file_types*
292344g:latex_to_unicode_file_types
293345
0 commit comments