简体   繁体   English

在Atom编辑器中使用Iex open命令中的Elixir

[英]Using Elixir from iex open command with Atom Editor

I want to open files from iex> open() with Atom or vim. 我想使用Atom或vim从iex> open()打开文件。 I tried to put on my ~/.zshrc : 我试图穿上~/.zshrc

export ELIXIR_EDITOR="atom +__LINE__ __FILE__"

or 要么

export ELIXIR_EDITOR="/usr/local/bin/atom +__LINE__ __FILE__"

or 要么

export ELIXIR_EDITOR="vim +__LINE__ __FILE__"

or 要么

export ELIXIR_EDITOR="vi +__LINE__ __FILE__"

or 要么

export ELIXIR_EDITOR="open -a Terminal 'vim +__LINE__ __FILE__'"

or 要么

export ELIXIR_EDITOR="open -a Terminal 'nvim +__LINE__ __FILE__'"

and nothing work's. 没有任何作用。 My version of Elixir is 1.7.4 on Mac OS X Mojave. 在Mac OS X Mojave上,我的Elixir版本是1.7.4。

[UPDATE] [UPDATE]

The error when I try to use with vim is this: iex(1)> open String.at/2 The file /Users/romenigld/workspace/elixir/ebooks/learn_functional_programming_with_elixir/ch06_designing_your_elixir_applications/dungeon_crawl/vim +1744 "/Users/romenigld/.asdf/installs/elixir/1.7.4/lib/elixir/lib/string.ex" does not exist. 我尝试与vim一起使用时的错误是: iex(1)> open String.at/2 The file /Users/romenigld/workspace/elixir/ebooks/learn_functional_programming_with_elixir/ch06_designing_your_elixir_applications/dungeon_crawl/vim +1744 "/Users/romenigld/.asdf/installs/elixir/1.7.4/lib/elixir/lib/string.ex" does not exist.

Maybe it's a problem with the asdf? 也许是asdf的问题? I don't know! 我不知道!

The error message is probably correct in that there is no lib/string.ex . 错误消息可能是正确的,因为没有lib/string.ex If you check out the contents of the install you'll notice they are all be beam files. 如果您检查安装的内容,您会发现它们都是beam文件。 Note the documentation mentions this ... 请注意文档中提到了这一点...

Keep in mind the location may not exist when opening precompiled source code. 请记住,打开预编译的源代码时该位置可能不存在。

The IEx helper will however work for source files in your mix project. 但是,IEx帮助程序将对您的混合项目中的源文件起作用。

In the case of Atom what I can confirm works is: 对于Atom,我可以确认的工作原理是:

export ELIXIR_EDITOR="/path/to/Atom.app/Contents/MacOS/Atom __FILE__:__LINE__"

我正在互联网上寻找,我找到了这个解决方案,人们用来激活打开文件的命令原子,现在可以使用了!

export ELIXIR_EDITOR="sh /Applications/Atom.app/Contents/Resources/app/atom.sh"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM