Unicode Autocomplete

After a long time of testing kakoune with julia within my usual coding environment (i3 and tmux), I’m astonished how nice this editor is, especially with the flawless language server integration for julia.

However, I do miss one feature which is autocomplete for unicode character, as done in this vim plugin: GitHub - JuliaEditorSupport/julia-vim: Vim support for Julia.

Is there something equivalent for LaTeX to Unicode substitution and if not, how would I get started to write such a plugin?

Thanks for this great piece of software!
Max

I think you can achieve the same with snippets, and they are in general more powerful.
I have not tested snippets in Kakoune because I need to train coding without them,
but I know at least these two plugins exist: kakoune-snippets and snippets.kak.

Alternatively, if you are just interested in a small amount of greek letter and not every mathematic symbol,
I use the following for writing latex and it may serve you (you can write formulas with unicode support with luatex):

hook global WinSetOption filetype=(latex|julia) %{
    map window insert <a-a> α
    map window insert <a-b> β
    # map window insert <a-c> γ
    map window insert <a-d> δ
    map window insert <a-e> ε
    map window insert <a-f> φ
    map window insert <a-g> γ
    map window insert <a-h> η
    map window insert <a-i> ι
    # map window insert <a-j> 
    map window insert <a-k> κ
    map window insert <a-l> λ
    map window insert <a-m> μ
    # map window insert <a-n> 
    map window insert <a-o> ω
    map window insert <a-p> π
    # map window insert <a-q> 
    map window insert <a-r> ρ
    map window insert <a-s> σ
    map window insert <a-t> τ
    # map window insert <a-u> 
    # map window insert <a-v> 
    # map window insert <a-w> π
    map window insert <a-x> ξ
    # map window insert <a-y> 
    map window insert <a-z> ζ

    map window insert <a-=> ≠
}

Basically, I map a-key to its corresponding greek letter and this lets me type very fast.
Just for greek letters is probably the fastest thing.
And if you want some operators you can bind them to the closest match with a-operator (for example I use it for not equals).
On the other hand, if you also want to be able to type a lot of operators maybe it’s not the best idea and you prefer to type a word.
In which case I would investigate the snippet plugins.

1 Like

useredsa’s comment about greek letters reminded me of digraphs.kak:

This plugin allows you to insert greek letters (and other unicode symbols) directly in your document. If your document is latex source code, however, then you will need unicode-input support in latex as well.

2 Likes