# Dividing Julia file in sections (VS code)

**URL:** <https://discourse.julialang.org/t/dividing-julia-file-in-sections-vs-code/63001>\
**Category:** General Usage\
**Tags:** question\
**Created:** [June 16, 2021, 12:05pm UTC](https://discourse.julialang.org/t/dividing-julia-file-in-sections-vs-code/63001 "2021-06-16T12:05:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![eilbuga](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/eilbuga/32/26152_2.png) [@eilbuga](https://discourse.julialang.org/u/eilbuga)\
**Post date:** [June 16, 2021, 12:05pm UTC](https://discourse.julialang.org/t/dividing-julia-file-in-sections-vs-code/63001/1 "2021-06-16T12:05:38Z")

</div>

Hi everyone,

I was wondering if you can divide your Julia file in sections. I use this a lot when coding in Python so I don’t have to run every piece of code all the time. In Python VS code we can use `#%%` to divide in sections. But I couldn’t find the same operation for Julia. Is there something similar for Julia?

Thanks for helping me out.

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [June 16, 2021, 12:21pm UTC](https://discourse.julialang.org/t/dividing-julia-file-in-sections-vs-code/63001/2 "2021-06-16T12:21:20Z")

</div>

Yes, this is discussed in the docs here:

[https://www.julia-vscode.org/docs/stable/userguide/runningcode/#Julia:-Execute-Code-Cell-(ShiftEnter)-1](https://www.julia-vscode.org/docs/stable/userguide/runningcode/#Julia:-Execute-Code-Cell-(ShiftEnter)-1)

You can delimit blocks with `##` and execute them with the `Julia: Excecute Code Cell` command (which apparently is bound to Shift-Enter in standard keybindings, but I’ve changed mine so can’t check).

---

<div class="post-metadata">

**Author:** ![Pino](https://avatars.discourse-cdn.com/v4/letter/p/d2c977/32.png) [@Pino](https://discourse.julialang.org/u/Pino)\
**Post date:** [February 23, 2025, 2:13pm UTC](https://discourse.julialang.org/t/dividing-julia-file-in-sections-vs-code/63001/3 "2025-02-23T14:13:52Z")

</div>

I’ve a problem using VS code that seems related to this. If I try to run code cells with Shift+Enter (as I used to), blocks of code are run instead than single lines. Has something changed with recent Julia or VS code updates? I never did divided files in sections

---

<div class="post-metadata">

**Author:** ![Nathan\_Boyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nathan_boyer/32/14825_2.png) [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Post date:** [February 24, 2025, 3:01pm UTC](https://discourse.julialang.org/t/dividing-julia-file-in-sections-vs-code/63001/4 "2025-02-24T15:01:03Z")

</div>

You can set your own keyboard shortcuts for VSCode commands under File → Preferences → Keyboard Shortcuts.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/2/f/2ffdc71a688cff1eeafb227145db36c4ce8475b1.png)

To run one line at a time, you probably want to set a shortcut for the VSCode command `Julia: Send Current Line or Selection to REPL`.

You can search through all available commands under View → Command Palette.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/2/e23fe9d5b5058d6700af2c2a66fd0c9f7579f1b4.png)
