How to custom unicode completions?

I want to add 𝄫(double flat) and 𝄪(double sharp) to REPL unicode completion, but I don’t know how to do.

I found this in github, but it seems that the Base module does not export the REPLCompletions submodule, and the REPLCompletions module does not export latex_symbols, so latex_symbols cannot be modified directly in startup.jl

1 Like

Perhaps add to your ~/.julia/config/startup.jl :

using REPL
atreplinit() do repl
    REPL.REPLCompletions.latex_symbols["\\dflat"] = "𝄫"

I don’t think you have to wait for the REPL to be initialized — you should just do it immediately:

import REPL
REPL.REPLCompletions.latex_symbols["\\dflat"] = "𝄫"

It would be reasonable to add \doubleflat and \doublesharp (or maybe \flat2 and \sharp2, or …?) to the global table in a future version. Just submit a patch to REPL/src/latex_symbols.jl. We’re pretty permissive about adding new symbol tab completions.

1 Like

Thank you for your reply! Very useful.

I have opened a pull request for adding these musical symbols.