Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

Four spaces indent in CDSW web editor

avatar

Hi,

in our CDSW setup the autoindent feature uses a tab with a width of 2 spaces when creating a newline in a .py Python script.

 

E.g. on a newline after:

for i in range(n):

  <- 2-spaces wide tab gets automatically added here

 

Is there a way to configure this to use 4 spaces instead of the tab?

5 REPLIES 5

avatar

@DianaTorres@Gopinathany help on this would again be greatly appreciated 🙂

avatar
Rising Star

Screenshot 2023-05-25 at 7.31.41 PM.png

avatar
Rising Star

CDSW/CML uses brackets editor. You may have a look at the brackets documentations for further customisation needs.

avatar

Thank you very much. This was of great help.

 

I read that one could edit the brackets.json to enable programming language-specific settings. Is something like outlined in this SO answer possible in the CDSW?

"language": {
    "html": {
        "spaceUnits": 4
    },
    "javascript": {
        "tabSize": 2
    }
}

https://stackoverflow.com/a/29808575/3107708

 

Edit: We are currently struggling to even find the brackets.json file in our CDSW. Is such a file available in principle? Should we create it and place it in a specific directory?

avatar

Hi @Gopinath 

We are currently struggling to find the brackets.json file in our CDSW. Is such a file available in principle or would we need to create it and place it in a specific directory?