# Setting the editor for \`@edit\` in the REPL

**URL:** <https://discourse.julialang.org/t/setting-the-editor-for-edit-in-the-repl/4812>\
**Category:** General Usage\
**Tags:** question, repl, edit\
**Created:** [July 12, 2017, 3:49pm UTC](https://discourse.julialang.org/t/setting-the-editor-for-edit-in-the-repl/4812 "2017-07-12T15:49:53Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [July 12, 2017, 3:49pm UTC](https://discourse.julialang.org/t/setting-the-editor-for-edit-in-the-repl/4812/1 "2017-07-12T15:49:54Z")

</div>

Right now, `@edit` opens up TextEdit on my mac, which is not great for editing (especially since it has no line numbering by default, which makes it difficult to jump to the function). How does one specify the editor (e.g. VSCode) to use when opening a file using `@edit`?

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [July 12, 2017, 3:55pm UTC](https://discourse.julialang.org/t/setting-the-editor-for-edit-in-the-repl/4812/2 "2017-07-12T15:55:21Z")

</div>

Presumably its the `EDITOR` environment/BASH variable, it is in Linux. Also it should jump straight to the function, at least it does with emacs.

---

<div class="post-metadata">

**Author:** ![anon94023334](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Post date:** [July 12, 2017, 4:04pm UTC](https://discourse.julialang.org/t/setting-the-editor-for-edit-in-the-repl/4812/3 "2017-07-12T16:04:36Z")

</div>

That did it. Unfortunately the repl won’t pass the line number to VSCode:

```julia
Unknown editor: no line number information passed.
The method is defined at line 33.

```

---

<div class="post-metadata">

**Author:** ![cormullion](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cormullion/32/49131_2.png) [@cormullion](https://discourse.julialang.org/u/cormullion)\
**Post date:** [July 12, 2017, 4:31pm UTC](https://discourse.julialang.org/t/setting-the-editor-for-edit-in-the-repl/4812/4 "2017-07-12T16:31:41Z")

</div>

In your `.juliarc.jl`:

```
ENV["JULIA_EDITOR"] = "atom"

```

might (_mutatis mutandis_) also work.

---

<div class="post-metadata">

**Author:** ![AbhimanyuAryan](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abhimanyuaryan/32/15733_2.png) [@AbhimanyuAryan](https://discourse.julialang.org/u/AbhimanyuAryan)\
**Post date:** [November 12, 2021, 5:55pm UTC](https://discourse.julialang.org/t/setting-the-editor-for-edit-in-the-repl/4812/5 "2021-11-12T17:55:40Z")

</div>

add below in bottom of `~/.julia/config/startup.jl`  
`ENV["JULIA_EDITOR"] = "vim"`
