Skip to content

Commit

Permalink
Document workarounds for lower Vim versions
Browse files Browse the repository at this point in the history
see also #23
  • Loading branch information
carlobaldassi committed May 30, 2014
1 parent 96cef16 commit e35c248
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 6 deletions.
19 changes: 18 additions & 1 deletion README.md
Expand Up @@ -45,7 +45,8 @@ Unicode symbols (e.g. `α`). By default, these substitutions must be triggered e
`<Tab>` key, as in the Julia command line (the REPL); however, an automatic, as-you-type mode can also
be activated.

These features are only available with Vim version 7.4 or higher.
These features only work as described with Vim version 7.4 or higher. Tab completion can still be made
available on lower Vim versions, see below for more details.

The following sections provide details on this features. The complete documentation is provided by calling
`:help julia-vim` from within Vim.
Expand Down Expand Up @@ -88,6 +89,20 @@ substitution to Unicode.
[YouCompleteMe]: https://github.com/Valloric/YouCompleteMe
[neocomplcache]: https://github.com/Shougo/neocomplcache.vim

#### Using this feature on Vim versions lower than 7.4

The automatic remapping of the `<Tab>` key is not performed if Vim version is lower than 7.4. However, the
functionality can still be used via the omnicompletion mechanism, i.e. by using `CTRL-X + CTRL-O`. You can
map this to some more convenient key combination, e.g. you may want to add something like this line to your
`.vimrc` file:

```
inoremap <C-Tab> <C-X><C-O>
```

This would map the functionality to `CTRL-Tab`. However, if you try to map this to `<Tab>`, you'd only be
able to use literal `<Tab>` by using `CTRL-V + <Tab>`.

### LaTeX-to-Unicode as you type

An automatic substitution mode can be activated by using the command `:let g:julia_auto_latex_to_unicode = 1`,
Expand All @@ -104,3 +119,5 @@ This does not interfere with the `<Tab>` mapping discussed above.

The `g:julia_auto_latex_to_unicode` setting can also be changed from the Vim command-line, but you will
also need to give the command `:call JuliaLaTeXtoUnicodeInit()` for the change to take effect.

This feature is not available with Vim versions lower then 7.4.
27 changes: 22 additions & 5 deletions doc/julia-vim.txt
Expand Up @@ -58,7 +58,9 @@ This Vim plug-in extends this functionality:
- optionally, symbols are substituted on the fly as you type them, see
|julia-vim-L2U-as-you-type|

These features are only available with Vim version 7.4 or higher.
These features only work as described with Vim version 7.4 or higher. Tab
completion can still be made available on lower Vim versions, see
|julia-vim-L2U-workaround|.

------------------------------------------------------------------------------
LATEX TO UNICODE VIA TAB KEY *julia-vim-L2U-tab*
Expand Down Expand Up @@ -116,14 +118,29 @@ match for `\nequiv` (`≢`). By default, if <Tab> finds an exact match performs
the substitution, but this can be controlled by the
|g:julia_latex_to_unicode_eager| setting.

Vim versions lower than 7.4 *julia-vim-L2U-workaround*

The <Tab> key remapping is not performed by default with Vim versions lower
than 7.4. However, the functionality is still available via onmicompletion,
which is accessible by the CTRL-X CTRL-O key combination. You can map some
other key combination to this by adding something like
>
inoremap <C-Tab> <C-X><C-O>
<
in your |.vimrc| file. If you'd map <Tab> directly, then you'd need to use
CTRL-V <Tab> to insert a literal <Tab>.

The settings |g:julia_latex_to_unicode_eager| and
|g:julia_latex_suggestions_enabled| are still meaningful in this case.

------------------------------------------------------------------------------
LATEX TO UNICODE AS YOU TYPE *julia-vim-L2U-as-you-type*

This feature is disabled by default, see |g:julia_auto_latex_to_unicode|. It
consists in substituting valid LaTeX sequences with Unicode symbols
automatically as the typing progresses, as soon as the sequences is
unambiguously complete. For example, when typing:
This feature is disabled by default, see |g:julia_auto_latex_to_unicode|, and
it is only available with Vim version 7.4 or higher. It consists in
substituting valid LaTeX sequences with Unicode symbols automatically as the
typing progresses, as soon as the sequences is unambiguously complete. For
example, when typing:
>
\chi\^2 = 1
<
Expand Down

0 comments on commit e35c248

Please sign in to comment.