zeyuz
zeyuz

Reputation: 86

Rstudio like auto indentation in VSCode/Julia

I'm getting into using Julia from usually using R/Rstudio. One of Rstudio's most useful features was its ability to automatically indent code when I press enter while typing out. E.g. I can press enter after typing out "3," and the end of the vector and it will automatically indent like so:

matrix(c(1, 2, 3,
         4, 5, 6),
       2, 3)

Is there a way to replicate this functionality with Julia/VScode? E.g. type out the following and/or other functions without manually entering spaces

array_1 = [1 2 3:
           4 5 6]

Upvotes: 3

Views: 364

Answers (2)

Cameron Bieganek
Cameron Bieganek

Reputation: 7694

If you manually indent the second row of the matrix, then subsequent rows will be indented automatically.

automatic matrix indentation

Upvotes: 3

Damjan Temelkovski
Damjan Temelkovski

Reputation: 281

If you press <enter> after the [, all indentation will be automatic thereafter

array_1 = [
    1 2 3;
    4 5 6
]
   

Upvotes: 3

Related Questions