Elixir交互式Shell: 5. 配置IEx

Elixir交互式Shell: 1. 运行时系统标记
Elixir交互式Shell: 2. 常用命令
Elixir交互式Shell: 3. 创建本地和远程Shell
Elixir交互式Shell: 4. 处理文件和脚本
Elixir交互式Shell: 5. 配置IEx

这是IEx系列五部分中的最后一部分, 在这一部分中, 我们将说明如何配置IEx.

显示配置文档

iex(10)> h IEx.configure

设置列表显示数目

iex(11)> IEx.configure(inspect: [limit: 3])
:ok
iex(12)> [1,2,3,4,5]
[1, 2, 3, ...]

设置文档标题颜色

iex(13)> h Code
iex(14)> IEx.configure(colors: [doc_title: [:blue, :bright, :reverse]])
:ok
iex(15)> h Code 

获取IEx当前配置

iex(18)> IEx.configuration                    
[width: 80, default_prompt: "%prefix(%counter)>", inspect: [limit: 1000],
 colors: [enabled: true, eval_interrupt: [:yellow], eval_result: [:yellow],
  eval_error: [:red], eval_info: [:normal], stack_app: [:red, :bright],
  stack_info: [:red], ls_directory: [:blue], ls_device: [:green],
  doc_bold: [:bright], doc_code: [:cyan, :bright], doc_headings: [:yellow],
  doc_inline_code: [:cyan], doc_table_heading: [:reverse],
  doc_underline: [:underline], doc_title: [:blue, :bright, :reverse]],
 history_size: 20, alive_prompt: "%prefix(%node)%counter>"]

启动IEx时自动配置

编辑~/.iex.exs文件

IEx.configure(colors: [doc_title: [:blue, :bright, :reverse]])

设置输出缓冲区宽度

IEx.configure(width: 1000)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值