简体   繁体   中英

Using Elixir from iex open command with Atom Editor

I want to open files from iex> open() with Atom or vim. I tried to put on my ~/.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.

[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.

Maybe it's a problem with the asdf? I don't know!

The error message is probably correct in that there is no lib/string.ex . If you check out the contents of the install you'll notice they are all be beam files. 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.

In the case of Atom what I can confirm works is:

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

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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