Skip to content

Instantly share code, notes, and snippets.

@am-kantox
Created March 3, 2017 06:29
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save am-kantox/b32ada39a5c944e456289e757ab47271 to your computer and use it in GitHub Desktop.
Save am-kantox/b32ada39a5c944e456289e757ab47271 to your computer and use it in GitHub Desktop.
Fancy IEx config
# IEx.configure colors: [enabled: true]
# IEx.configure colors: [eval_result: [:cyan, :bright]]
{fortune, 0} = System.cmd "fortune", [] # displays the fortune prompt
IO.puts IO.ANSI.red_background() <> IO.ANSI.white() <> "▷ #{fortune}" <> IO.ANSI.reset
Application.put_env(:elixir, :ansi_enabled, true)
IEx.configure(
colors: [
eval_result: [:green, :bright] ,
eval_error: [[:red, :bright, "\n▶▶▶\n"]],
eval_info: [:yellow, :bright ],
],
default_prompt: [
"\e[G", # cursor ⇒ column 1
:green, "%prefix", :white, "|", :green, "%counter", " ", :blue, "▶", :reset
] |> IO.ANSI.format |> IO.chardata_to_string
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment