↓ Ir para o conteúdo principal

← todas as notas

📎 Webclip

Speed up your daily work with Elixir console tricks

The article lists IEx tricks meant to make daily Elixir work smoother. It points to built-in help, autocomplete, shell history, multiline input, previous results, faster recompilation, and a local .iex.exs file for imports, aliases, variables, and IEx configuration.

Reading notes
#

  • Use h in IEx to check documentation for built-in modules instead of switching to a browser.
  • iex -S mix gives access to project modules and their docs, including @doc and @moduledoc.
  • Tab completion helps with module and function names, and it only shows public functions.
  • Shell history can be enabled with iex --erl "-kernel shell_history enabled" or by setting ERL_AFLAGS.
  • IEx supports multiline pasting and can reuse the previous result with v() when a pasted expression starts with a binary operator.
  • Previous results can be reused for debugging or for computations that are expensive to run again.
  • recompile lets you test code changes without restarting the console.
  • A local .iex.exs can import modules, add aliases, set variables, and configure IEx on startup.