# \#sigils

**URL:** https://forum.elixirforum.com/tag/sigils/1.md

[Latest](https://forum.elixirforum.com/latest.md) · [Categories](https://forum.elixirforum.com/categories.md) · [Tags](https://forum.elixirforum.com/tags.md)

---

## [Gettext\_sigils - a sigil for using gettext with less boilerplate and better readability](https://forum.elixirforum.com/t/gettext-sigils-a-sigil-for-using-gettext-with-less-boilerplate-and-better-readability/74645)

<div class="topic-metadata">

**Author:** [@hwuethrich](https://forum.elixirforum.com/u/hwuethrich)\
**Replies:** 49\
**Last updated:** [April 14, 2026, 4:01pm UTC](https://forum.elixirforum.com/t/gettext-sigils-a-sigil-for-using-gettext-with-less-boilerplate-and-better-readability/74645 "2026-04-14T16:01:16Z")

</div>

Hi! I’m happy to share my first Elixir library. But first some … Background As an Elixir company from a country with 4 official languages (:switzerland:), trust me when I say: we are using Gettext a lot in our Phoenix …

---

## [Sigils are (not only) macros](https://forum.elixirforum.com/t/sigils-are-not-only-macros/71248)

<div class="topic-metadata">

**Author:** [@mudasobwa](https://forum.elixirforum.com/u/mudasobwa)\
**Replies:** 4\
**Last updated:** [June 12, 2025, 8:51am UTC](https://forum.elixirforum.com/t/sigils-are-not-only-macros/71248 "2025-06-12T08:51:00Z")

</div>

No they are not (not necessarily, at least.)

---

## [Mix format plugins and lowercase sigils not working](https://forum.elixirforum.com/t/mix-format-plugins-and-lowercase-sigils-not-working/62158)

<div class="topic-metadata">

**Author:** [@zkessin](https://forum.elixirforum.com/u/zkessin)\
**Replies:** 7\
**Last updated:** [March 8, 2024, 9:22pm UTC](https://forum.elixirforum.com/t/mix-format-plugins-and-lowercase-sigils-not-working/62158 "2024-03-08T21:22:02Z")

</div>

I am trying to use mix format to format some graphql code but when I define the plugin it will work with a capital sigil IE ~G but not a lowercase one ~g. The problem is that some of the test code requires string interpo…

---

## [Sigil\_r example not working as shown in the official docs](https://forum.elixirforum.com/t/sigil-r-example-not-working-as-shown-in-the-official-docs/58949)

<div class="topic-metadata">

**Author:** [@Kin](https://forum.elixirforum.com/u/Kin)\
**Replies:** 3\
**Last updated:** [October 13, 2023, 9:50am UTC](https://forum.elixirforum.com/t/sigil-r-example-not-working-as-shown-in-the-official-docs/58949 "2023-10-13T09:50:31Z")

</div>

I am following the elixir official docs and on the sigil page here https://elixir-lang.org/getting-started/sigils.html#custom-sigils this example: sigil\_r(\<\<"foo"\>\>, ~c"i") is not working for me. The output should be …

---

## [Why do macro sigils accept a bitstring literal instead of a string literal?](https://forum.elixirforum.com/t/why-do-macro-sigils-accept-a-bitstring-literal-instead-of-a-string-literal/58340)

<div class="topic-metadata">

**Author:** [@garrison](https://forum.elixirforum.com/u/garrison)\
**Replies:** 3\
**Last updated:** [September 17, 2023, 8:12pm UTC](https://forum.elixirforum.com/t/why-do-macro-sigils-accept-a-bitstring-literal-instead-of-a-string-literal/58340 "2023-09-17T20:12:34Z")

</div>

The first time I tried to create a custom (macro) sigil, I assumed the first argument would be a string as I knew string literals represented themselves in the AST. Of course, a quick look into the Elixir source reveals t…

---

## [Parameters for custom sigil](https://forum.elixirforum.com/t/parameters-for-custom-sigil/58218)

<div class="topic-metadata">

**Author:** [@Anber96](https://forum.elixirforum.com/u/Anber96)\
**Replies:** 1\
**Last updated:** [September 11, 2023, 12:37pm UTC](https://forum.elixirforum.com/t/parameters-for-custom-sigil/58218 "2023-09-11T12:37:44Z")

</div>

Hi, i have a thought regarding my phoenix application and translations. I might have understood it wrong, but here it goes. I want to create a custom sigil ~t which helps with translation of text with the help of gettex…

---

## [Why are sigils only possible with single character names?](https://forum.elixirforum.com/t/why-are-sigils-only-possible-with-single-character-names/43453)

<div class="topic-metadata">

**Author:** [@wolf4earth](https://forum.elixirforum.com/u/wolf4earth)\
**Replies:** 2\
**Last updated:** [March 15, 2023, 5:58pm UTC](https://forum.elixirforum.com/t/why-are-sigils-only-possible-with-single-character-names/43453 "2023-03-15T17:58:07Z")

</div>

As the title suggests, I wonder what the reasoning is behind only allowing “single character sigils”. The thought came to me while looking at the documentation of the ~U sigil for UTC DateTimes and I thought that this w…

---

## [Is it possible to get a sigil from a string?](https://forum.elixirforum.com/t/is-it-possible-to-get-a-sigil-from-a-string/52908)

<div class="topic-metadata">

**Author:** [@yolo007wizard](https://forum.elixirforum.com/u/yolo007wizard)\
**Replies:** 3\
**Last updated:** [January 2, 2023, 5:29pm UTC](https://forum.elixirforum.com/t/is-it-possible-to-get-a-sigil-from-a-string/52908 "2023-01-02T17:29:34Z")

</div>

For example, if I have a json payload: { "inputs":{ "key": "~jp(event/key1/1/key2)", "key2": "str" } } The goal is to transform the the string to a custom json-pointer sigil ~jp(json-pointer-string) My nai…

---

## [Destructing assignment](https://forum.elixirforum.com/t/destructing-assignment/5686)

<div class="topic-metadata">

**Author:** [@Aetherus](https://forum.elixirforum.com/u/Aetherus)\
**Replies:** 6\
**Last updated:** [October 19, 2022, 8:23am UTC](https://forum.elixirforum.com/t/destructing-assignment/5686 "2022-10-19T08:23:50Z")

</div>

I want to mimic ES6’s destructing assignment using Elixir’s sigil. What I want to achieve is ~m{foo bar} = %{foo: 1, bar: 2} foo #=\> 1 bar #=\> 2 So far I have the following code defmodule DestructingAssignment do …

---

## [How to replace deprecated ~E sigil with ~H in Phoenix render funciton](https://forum.elixirforum.com/t/how-to-replace-deprecated-e-sigil-with-h-in-phoenix-render-funciton/44798)

<div class="topic-metadata">

**Author:** [@Fl4m3Ph03n1x](https://forum.elixirforum.com/u/Fl4m3Ph03n1x)\
**Replies:** 5\
**Last updated:** [December 24, 2021, 1:52am UTC](https://forum.elixirforum.com/t/how-to-replace-deprecated-e-sigil-with-h-in-phoenix-render-funciton/44798 "2021-12-24T01:52:09Z")

</div>

Background In my quest to learn Phoenix LiveView I found myself using a render function that uses a deprecated sigil: def render(\_assigns) do ~E""" \<menubar\> \<menu label="\<%= gettext "File" %\>"\> …

---

## [How to correctly handle assigns in LiveView Sigil without getting Dialyzer warnings?](https://forum.elixirforum.com/t/how-to-correctly-handle-assigns-in-liveview-sigil-without-getting-dialyzer-warnings/34210)

<div class="topic-metadata">

**Author:** [@Sanjibukai](https://forum.elixirforum.com/u/Sanjibukai)\
**Replies:** 9\
**Last updated:** [August 9, 2021, 7:18am UTC](https://forum.elixirforum.com/t/how-to-correctly-handle-assigns-in-liveview-sigil-without-getting-dialyzer-warnings/34210 "2021-08-09T07:18:42Z")

</div>

Hello, It seems that any LiveView sigil is expected to have in its scope an assigns map. So not a keyword list or anything else, but a map. But often I end up with a Dialyzer error (or warning) that The pattern can ne…

---

## [How to inspect variables? Specifically ~U DateTime](https://forum.elixirforum.com/t/how-to-inspect-variables-specifically-u-datetime/27615)

<div class="topic-metadata">

**Author:** [@fireproofsocks](https://forum.elixirforum.com/u/fireproofsocks)\
**Replies:** 2\
**Last updated:** [December 16, 2019, 6:16pm UTC](https://forum.elixirforum.com/t/how-to-inspect-variables-specifically-u-datetime/27615 "2019-12-16T18:16:30Z")

</div>

I recently discovered the wonderful ~U sigil that can be used to create DateTime variables. However, what’s confusing to me is that you’d never know from looking at the result that you were in fact dealing with a %DateT…

---

## [What is the ~E sigil in the Drab tutorial?](https://forum.elixirforum.com/t/what-is-the-e-sigil-in-the-drab-tutorial/15273)

<div class="topic-metadata">

**Author:** [@Zesky665](https://forum.elixirforum.com/u/Zesky665)\
**Replies:** 18\
**Last updated:** [February 18, 2019, 4:15pm UTC](https://forum.elixirforum.com/t/what-is-the-e-sigil-in-the-drab-tutorial/15273 "2019-02-18T16:15:18Z")

</div>

Hi, I’m going through the examples on the drab page. In the ‘chat example’ section, in the code example. defhandler update\_chat(socket, sender) do nick = get\_store(socket, :nickname, "Anonymous") html = ~E"\<strong\>\<…

---

## [Pattern matching with sigils](https://forum.elixirforum.com/t/pattern-matching-with-sigils/18206)

<div class="topic-metadata">

**Author:** [@sc4224](https://forum.elixirforum.com/u/sc4224)\
**Replies:** 7\
**Last updated:** [November 25, 2018, 10:53pm UTC](https://forum.elixirforum.com/t/pattern-matching-with-sigils/18206 "2018-11-25T22:53:10Z")

</div>

Hi, having a problem refactoring using pattern matching for these lines of code defp check\_input(input, game = %State{}) do input = String.trim(input) cond do input =~ ~r/\\A\[a-z\]\\z/ -\> Map.put(game, :guess…

---

## [Concat Sigil ~E and others (how to)](https://forum.elixirforum.com/t/concat-sigil-e-and-others-how-to/10444)

<div class="topic-metadata">

**Author:** [@mbenatti](https://forum.elixirforum.com/u/mbenatti)\
**Replies:** 1\
**Last updated:** [November 29, 2017, 7:10pm UTC](https://forum.elixirforum.com/t/concat-sigil-e-and-others-how-to/10444 "2017-11-29T19:10:43Z")

</div>

Hello Guys, Elixir/phoenix have some helper to concat sigils? What do you think about this feature? Code: defmodule Teste do import Phoenix.HTML def sigil\_concat\_1() do ~E""" \<div class="col-lg-4"\> …
