# How to configure edit/define\_editor for vscode

**URL:** <https://discourse.julialang.org/t/how-to-configure-edit-define-editor-for-vscode/65050>\
**Category:** New to Julia\
**Tags:** question, vscode, editors\
**Created:** [July 21, 2021, 4:58pm UTC](https://discourse.julialang.org/t/how-to-configure-edit-define-editor-for-vscode/65050 "2021-07-21T16:58:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [July 21, 2021, 4:58pm UTC](https://discourse.julialang.org/t/how-to-configure-edit-define-editor-for-vscode/65050/1 "2021-07-21T16:58:56Z")

</div>

Hi,  
I am trying to use the function `edit` to open the source code of a given function. From the documentation it says that I have to configure/call `define_editor` first.  
Would someone be able to tell me how I can do that given that I am using vscode and running on windows.  
Thank you

---

<div class="post-metadata">

**Author:** ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Post date:** [July 21, 2021, 8:24pm UTC](https://discourse.julialang.org/t/how-to-configure-edit-define-editor-for-vscode/65050/2 "2021-07-21T20:24:27Z")

</div>

consider

```julia
ENV["JULIA_EDITOR"]="\"C:\\Program Files\\Microsoft VS Code\\Code.exe\""

```

I have this in my startup.jl file in c:\users\yourname.julia\config  
Now `@edit maximum(3,2)` opens VS code.

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [July 21, 2021, 8:58pm UTC](https://discourse.julialang.org/t/how-to-configure-edit-define-editor-for-vscode/65050/3 "2021-07-21T20:58:33Z")

</div>

From [this post](https://discourse.julialang.org/t/what-is-in-your-startup-jl/18228/19), the line below in startup.jl produces the same result (Win10):

```julia
ENV["JULIA_EDITOR"] = "code.cmd -g"

```

---

<div class="post-metadata">

**Author:** ![gitboy16](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gitboy16/32/24906_2.png) [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Post date:** [July 22, 2021, 8:10am UTC](https://discourse.julialang.org/t/how-to-configure-edit-define-editor-for-vscode/65050/4 "2021-07-22T08:10:57Z")

</div>

This does not work for me. Probably I need to have vscode installed in my environment variable PATH. I have installed vscode from zip file.
