# Tab completion for numeric codepoints

**URL:** <https://discourse.julialang.org/t/tab-completion-for-numeric-codepoints/35411>\
**Category:** General Usage\
**Tags:** question\
**Created:** [March 2, 2020, 2:46pm UTC](https://discourse.julialang.org/t/tab-completion-for-numeric-codepoints/35411 "2020-03-02T14:46:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [March 2, 2020, 2:46pm UTC](https://discourse.julialang.org/t/tab-completion-for-numeric-codepoints/35411/1 "2020-03-02T14:46:30Z")

</div>

Hi, is there a way to get a Unicode character from its numeric code in the REPL (without resorting to copy and paste)?

I was trying to input the ace of each card suit (spade, heart, club, diamond) based on the codepoints: U+1f0a1, U+1f0b1, U+1f0c1, U+1f0d1. I can get the character with ‘\U1f0a1’ but typing \U1f0a1 and hitting Tab does not “complete” like it does for \spadesuit for example. And using ‘\U…’ then Enter then copy-paste is a bit annoying…

---

<div class="post-metadata">

**Author:** ![tkluck](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tkluck/32/15769_2.png) [@tkluck](https://discourse.julialang.org/u/tkluck)\
**Post date:** [March 2, 2020, 3:18pm UTC](https://discourse.julialang.org/t/tab-completion-for-numeric-codepoints/35411/2 "2020-03-02T15:18:59Z")

</div>

That’s the responsibility of your operating system’s input method, not Julia’s. For example, [in Ubuntu, you can use ctrl+shift+U, then type the number, then return](https://askubuntu.com/questions/31258/how-can-i-type-a-unicode-character-for-example-em-dash). There’s probably something similar for Mac & Windows.

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [March 2, 2020, 3:21pm UTC](https://discourse.julialang.org/t/tab-completion-for-numeric-codepoints/35411/3 "2020-03-02T15:21:17Z")

</div>

Indeed! Thanks!

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [March 2, 2020, 4:51pm UTC](https://discourse.julialang.org/t/tab-completion-for-numeric-codepoints/35411/4 "2020-03-02T16:51:47Z")

</div>

> [@sijo](#):
>
> I was trying to input the ace of each card suit (spade, heart, club, diamond) based on the codepoints:

Note that in the REPL (and many Julia editors that have adopted the REPL’s tab completions), you can tab-complete `\spadesuit` etcetera for these characters.

The help mode will tell you that:

```julia
help?> ♠
"♠" can be typed by \spadesuit<tab>

```

_Update:_ I see that you actually want `🂡` (U+1f0a1) etcetera, for which we don’t (yet) have a tab completion. You could add a tab completion via:

```julia
import REPL
push!(REPL.REPLCompletions.latex_symbols, "\\spadeace" => "\U1f0a1")

```

e.g. in your `~/.julia/config/startup.jl ` file.

(Or you could just type `A\spadesuit<tab>` to get `A♠`, which is a reasonable substitute for `🂡`.)

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [March 2, 2020, 5:03pm UTC](https://discourse.julialang.org/t/tab-completion-for-numeric-codepoints/35411/5 "2020-03-02T17:03:01Z")

</div>

We _could_ certainly add `\U....` tab completion in the REPL, however! It’s an interesting feature idea.

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [March 2, 2020, 5:18pm UTC](https://discourse.julialang.org/t/tab-completion-for-numeric-codepoints/35411/6 "2020-03-02T17:18:20Z")

</div>

Thanks for mentioning the `push!` solution, although so far I’ve only felt the need for such codes in one-off situations.

@tkluck’s solution works for me but I can see small benefits of having `\U...` completion in the REPL: more discoverable (for some users at least), and the Ctrl-Shift-U shortcut shows weird artefacts in some terminals (not Julia’s fault of course).

---

<div class="post-metadata">

**Author:** ![sijo](https://avatars.discourse-cdn.com/v4/letter/s/da6949/32.png) [@sijo](https://discourse.julialang.org/u/sijo)\
**Post date:** [March 2, 2020, 5:25pm UTC](https://discourse.julialang.org/t/tab-completion-for-numeric-codepoints/35411/7 "2020-03-02T17:25:56Z")

</div>

For some reason there are actually some numeric codepoints that can be expanded with the emoji syntax:

```julia
\:u5272:
\:u55b6:
\:u6708:
\:u6e80:
\:u7533:
\:u7a7a:
\:u5408:
\:u6307:
\:u6709:
\:u7121:
\:u7981:

```

They appear to be Chinese characters: 🈹 🈺 🈷 🈵 🈸 🈳 🈴 🈯 🈶 🈚 🈲
