Skip to content

Commit

Permalink
Document "smart tab" option
Browse files Browse the repository at this point in the history
  • Loading branch information
carlobaldassi committed Apr 10, 2021
1 parent b94a77d commit b5292ed
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ is found (e.g. `\al`), a list of possible completions is suggested (e.g. `\aleph
`\alpha`), and it will be refined while you enter more characters; when only one match is left, pressing
<kbd>Tab</kbd> will complete it and pressing it again will perform the substitution to Unicode.

If you activate a "smart" mode by setting `g:latex_to_unicode_smart_tab = 1`, then you will also be
able to navigate the menu of suggestions with <kbd>Tab</kbd> and <kbd>SHIFT-Tab</kbd>, and to accept your
choice with <kbd>Enter</kbd>, similarly to other completion plugins.

If no suitable substitution is found, the action will fall back to whatever mapping was previously
defined: by default, inserting a literal `<Tab>` character, or invoking some other action if another
plug-in is installed, e.g. [supertab] or [YouCompleteMe].
Expand Down
31 changes: 31 additions & 0 deletions doc/julia-vim-L2U.txt
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,11 @@ match for `\nequiv` (`≢`). By default, if <Tab> finds an exact match it perfor
the substitution, but this can be controlled by the |g:latex_to_unicode_eager|
setting.

An additional option allows to configure the plugin to work in a more
"natural" way, similarly to other completion plug-ins, so that when a menu is
present it can be navigated with <Tab> and <S-Tab>, and entries can be
selected with <Enter>. See |g:latex_to_unicode_smart_tab|.

Command-line mode *julia-vim-L2U-cmdmode*

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

*g:latex_to_unicode_smart_tab*
g:latex_to_unicode_smart_tab

In "smart tab" mode, the <Tab> key can be used to scroll
through the list of suggestions when the menu produced by the
LaTex-to-Unicode plugin is present (otherwise this would be done
with <C-N>, see |i_CTRL-N|). This mode also remaps <S-Tab> to
scroll back (otherwise this would be done with <C-P>, see
|i_CTRL-P|) and it also remaps <Enter> to accept a suggestion
and perform the substitution (otherwise this would be done
with <Tab>).
In all cases, the remapped keys fall back to their original
behavior if no menu is present, or if it was not generated by
LaTeX-to-Unicode (this behavior may be the Vim default, or the
one from another existing mapping).

This only has an affect when `g:latex_to_unicode_tab` is
activated for insert mode. By default it is `0` (off).
You can enable the feature by default by inserting the line
>
let g:latex_to_unicode_auto = 1
<
in your |.vimrc| file. You can change this setting at any
moment while editing, but you need to invoke
|LaTeXtoUnicode#Init()| for the change to take effect.

*g:latex_to_unicode_suggestions*
g:latex_to_unicode_suggestions

Expand Down

0 comments on commit b5292ed

Please sign in to comment.