# Help! Does anyone know how to use JuliaFormatter in VSCode editor?

**URL:** <https://discourse.julialang.org/t/help-does-anyone-know-how-to-use-juliaformatter-in-vscode-editor/111714>\
**Category:** New to Julia\
**Tags:** vscode\
**Created:** [March 17, 2024, 2:54am UTC](https://discourse.julialang.org/t/help-does-anyone-know-how-to-use-juliaformatter-in-vscode-editor/111714 "2024-03-17T02:54:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Post date:** [March 17, 2024, 2:54am UTC](https://discourse.julialang.org/t/help-does-anyone-know-how-to-use-juliaformatter-in-vscode-editor/111714/1 "2024-03-17T02:54:06Z")

</div>

Help! Does anyone know how to use JuliaFormatter in VSCode editor?

I have installed JuliaFormater in VS Code editor but I don’t have a clue how to use it to format my Julia source code.

Can anyone give me some instructions?

Regards

---

<div class="post-metadata">

**Author:** ![Alexander\_Knudson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/alexander_knudson/32/215656_2.png) [@Alexander\_Knudson](https://discourse.julialang.org/u/Alexander_Knudson)\
**Post date:** [March 17, 2024, 3:04am UTC](https://discourse.julialang.org/t/help-does-anyone-know-how-to-use-juliaformatter-in-vscode-editor/111714/2 "2024-03-17T03:04:21Z")

</div>

[The docs](https://www.julia-vscode.org/docs/stable/userguide/formatter/) would be a good place to start. Do you have the Julia extension installed in vs code? Seems like it uses JuliaFormatter.jl to do it’s formatting, so all you need to do in vs code is call the format command (see docs or do Ctrl-Shift-P to open the command menu).

---

<div class="post-metadata">

**Author:** ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Post date:** [March 17, 2024, 3:26am UTC](https://discourse.julialang.org/t/help-does-anyone-know-how-to-use-juliaformatter-in-vscode-editor/111714/3 "2024-03-17T03:26:34Z")

</div>

Okay. I will give CTRL-Shift-P a try.

---

<div class="post-metadata">

**Author:** ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Post date:** [March 17, 2024, 3:31am UTC](https://discourse.julialang.org/t/help-does-anyone-know-how-to-use-juliaformatter-in-vscode-editor/111714/4 "2024-03-17T03:31:18Z")

</div>

No it is not working.

I wrote

```julia
function main(a,b)
c=a+b
end

```

and then I press CTRL-SHIFT-P but nothing changes

then I press COMMAND-A to select everything and then CTRL-SHIFT-P but nothing changes

---

<div class="post-metadata">

**Author:** ![PetrKryslUCSD](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/petrkryslucsd/32/215825_2.png) [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Post date:** [March 17, 2024, 3:42am UTC](https://discourse.julialang.org/t/help-does-anyone-know-how-to-use-juliaformatter-in-vscode-editor/111714/5 "2024-03-17T03:42:21Z")

</div>

The ctrl+shift+p should allow you to enter vs code commands (if you are on windows; it is I believe option+shift+p on the Mac).

---

<div class="post-metadata">

**Author:** ![gdalle](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gdalle/32/27854_2.png) [@gdalle](https://discourse.julialang.org/u/gdalle)\
**Post date:** [March 17, 2024, 6:24am UTC](https://discourse.julialang.org/t/help-does-anyone-know-how-to-use-juliaformatter-in-vscode-editor/111714/6 "2024-03-17T06:24:40Z")

</div>

To complement the response, the actual shortcut for formatting the file you’re in is `Ctrl + Shift + I`

---

<div class="post-metadata">

**Author:** ![Eben60](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eben60/32/13475_2.png) [@Eben60](https://discourse.julialang.org/u/Eben60)\
**Post date:** [March 17, 2024, 10:13am UTC](https://discourse.julialang.org/t/help-does-anyone-know-how-to-use-juliaformatter-in-vscode-editor/111714/7 "2024-03-17T10:13:28Z")

</div>

> [@StevenSiew](#):
>
> COMMAND-A to select everything and then CTRL-SHIFT-P

If you are on a Mac (apparently you are, using `COMMAND-A`), then the hotkey to call Command Palette is `COMMAND-SHIFT-P`). Alternatively Menu `View / Command Palette...`

Then you have to call actual `Format Document` command from there. The hotkey to call it directly is `OPTION-SHIFT-F` on my Mac.

I assume, you don’t need to install JuliaFormatter.jl on your own. In any case, I never did, and I have the working `Format Document` command on my Mac.

---

<div class="post-metadata">

**Author:** ![StevenSiew](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevensiew/32/218393_2.png) [@StevenSiew](https://discourse.julialang.org/u/StevenSiew)\
**Post date:** [March 17, 2024, 11:48am UTC](https://discourse.julialang.org/t/help-does-anyone-know-how-to-use-juliaformatter-in-vscode-editor/111714/8 "2024-03-17T11:48:55Z")

</div>

Thank you everyone.

On my MAC on VS Code editor. Option-Shift-F does format the julia code in the current selected text file. This solves my problem.

---

<div class="post-metadata">

**Author:** ![Arlo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/arlo/32/211461_2.png) [@Arlo](https://discourse.julialang.org/u/Arlo)\
**Post date:** [March 27, 2025, 5:01am UTC](https://discourse.julialang.org/t/help-does-anyone-know-how-to-use-juliaformatter-in-vscode-editor/111714/9 "2025-03-27T05:01:49Z")

</div>

The main Julia VSCode extension supports formatting based on options in `.JuliaFormatter.toml`, but you may need to set the “Editor: Default Formatter” setting for it to work.

Settings Search:

```julia
@id:editor.defaultFormatter @lang:julia

```

If `None` is not working for you, change it to `Julia`

 ![427345748-dfcfcb7e-0d5c-4c81-a4d6-519ae4c350d5](https://global.discourse-cdn.com/julialang/original/3X/f/b/fb29c454f6d3f476afbb38ee49052ec703e1981a.png)

This corresponds to Settings JSON :

```json
    "[julia]": {
        "editor.defaultFormatter": "julialang.language-julia"
    },

```

I don’t think there’s a need for the “Julia Formatter” extension by `oh7z`. Also, this just broke for me recently, but then I reset some of these `defaultFormatter` settings and now both `None` and `Julia` format based on the `.JuliaFormatter.toml`, so I suspect VSCode has some kind of cascading formatter configuration `None` may or may not work for you depending on your settings.
