Skip to content

Commit b5292ed

Browse files
committed
Document "smart tab" option
1 parent b94a77d commit b5292ed

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ is found (e.g. `\al`), a list of possible completions is suggested (e.g. `\aleph
4848
`\alpha`), and it will be refined while you enter more characters; when only one match is left, pressing
4949
<kbd>Tab</kbd> will complete it and pressing it again will perform the substitution to Unicode.
5050

51+
If you activate a "smart" mode by setting `g:latex_to_unicode_smart_tab = 1`, then you will also be
52+
able to navigate the menu of suggestions with <kbd>Tab</kbd> and <kbd>SHIFT-Tab</kbd>, and to accept your
53+
choice with <kbd>Enter</kbd>, similarly to other completion plugins.
54+
5155
If no suitable substitution is found, the action will fall back to whatever mapping was previously
5256
defined: by default, inserting a literal `<Tab>` character, or invoking some other action if another
5357
plug-in is installed, e.g. [supertab] or [YouCompleteMe].

doc/julia-vim-L2U.txt

+31
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,11 @@ match for `\nequiv` (`≢`). By default, if <Tab> finds an exact match it perfor
142142
the substitution, but this can be controlled by the |g:latex_to_unicode_eager|
143143
setting.
144144

145+
An additional option allows to configure the plugin to work in a more
146+
"natural" way, similarly to other completion plug-ins, so that when a menu is
147+
present it can be navigated with <Tab> and <S-Tab>, and entries can be
148+
selected with <Enter>. See |g:latex_to_unicode_smart_tab|.
149+
145150
Command-line mode *julia-vim-L2U-cmdmode*
146151

147152
In |Command-line| mode, the behavior is largely the same except that both
@@ -285,6 +290,32 @@ g:latex_to_unicode_tab
285290
while editing, but you need to invoke |LaTeXtoUnicode#Init()|
286291
for the change to take effect.
287292

293+
*g:latex_to_unicode_smart_tab*
294+
g:latex_to_unicode_smart_tab
295+
296+
In "smart tab" mode, the <Tab> key can be used to scroll
297+
through the list of suggestions when the menu produced by the
298+
LaTex-to-Unicode plugin is present (otherwise this would be done
299+
with <C-N>, see |i_CTRL-N|). This mode also remaps <S-Tab> to
300+
scroll back (otherwise this would be done with <C-P>, see
301+
|i_CTRL-P|) and it also remaps <Enter> to accept a suggestion
302+
and perform the substitution (otherwise this would be done
303+
with <Tab>).
304+
In all cases, the remapped keys fall back to their original
305+
behavior if no menu is present, or if it was not generated by
306+
LaTeX-to-Unicode (this behavior may be the Vim default, or the
307+
one from another existing mapping).
308+
309+
This only has an affect when `g:latex_to_unicode_tab` is
310+
activated for insert mode. By default it is `0` (off).
311+
You can enable the feature by default by inserting the line
312+
>
313+
let g:latex_to_unicode_auto = 1
314+
<
315+
in your |.vimrc| file. You can change this setting at any
316+
moment while editing, but you need to invoke
317+
|LaTeXtoUnicode#Init()| for the change to take effect.
318+
288319
*g:latex_to_unicode_suggestions*
289320
g:latex_to_unicode_suggestions
290321

0 commit comments

Comments
 (0)