Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to display a line for every python cell boundary in Visual Studio Code?

In VS Code, when working with python files, if we type #%% it creates a cell separation. When the cursor is within a cell, the editor displays a thick line for the top boundary and a thin line for the bottom boundary (of the current cell only). How can I change the style so that a line is always displayed for every cell boundary (like in the Spyder editor)?

Edit: I found these settings but they only apply to the interactive window and not the editor:

    "workbench.colorCustomizations": {
        "notebook.cellBorderColor": "#ff0000",
        "notebook.cellToolbarSeparator": "#00ff00"
    }

I am expecting to find a way of showing lines at the red arrows below: Missing Python cell delimiter lines

I have seen screenshots showing such lines but I can't find how.

Edit 2: Is there a way to customize the style/appearance of every inserted line showing the clickable commands Run Cell | Run Above | Debug Cell ?

like image 633
BinaryMonkey Avatar asked Apr 09 '26 01:04

BinaryMonkey


2 Answers

For those who come across this old question in 2024 and beyond: Meanwhile a setting was added to VSCode that does exactly this.

  1. Go to File>Preferences>Settings (or press "Ctrl+,") to open settings.
  2. Search for "Cell Marker: Decorate Cells". You should then see the setting: "Jupyther > Interactive Window > Cell Marker:Decorate Cells"
  3. Set the option to "allCells".

This should make all cell lines visible, as requested by the original thread creator.

like image 198
JSE Avatar answered Apr 10 '26 13:04

JSE


take a look at this: extension-visualstudio

maybe we need to checkout [vscode-python] (https://github.com/microsoft/vscode-python): package.nls.json stores a lot of dicts, but i can't find Run Cell | Run Above | Debug Cell too..

like image 28
prof_FL Avatar answered Apr 10 '26 15:04

prof_FL



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!