Search code examples
elixirphoenix-framework

how to configure environment for elixir shell such alias command when starting?


When using elixir shell, I always have to copy the code like following to shell terminal from ms word doc.

alias Mirror.Repo
alias Mirror.Imports.Importer

In erlang, I have write these code in the .erlang script file.

How to do it for elixir?


Solution

  • You can add it in an .iex.exs file at the root of your mix project.

    This is convenient for:

    • aliases and imports
    • configure inspect options

    This article provides some helpful examples.