Indenting VSCode like RStudio

Found a solution but there a few things to take note.

First, VSCode notive options are language-agnostic, meaning it can’t indent R code ’cause it doesn’t understand it. You got to download extensions to make i work.

Extensions required are

  1. Yuki Ueda’s R for language support
  2. REditorSupport’s R LSP Client

Also, in order to R LSP Client to work, CRAN package {languageserver} is required.

Then, usage. If you’re working functions, differently from RStudio in which one can hit ctrl+i and that’d indent that specifically line or selection, this solution works only if one selects the entire function. If you have functions inside another, you gotta indent everything (won’t work for just a foo inside another).

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top