REditorSupport / sublime-ide-r

R-IDE: Make Sublime Text a perfect IDE for R
MIT License
112 stars 7 forks source link

Autoindentation query / request #16

Closed hhau closed 5 years ago

hhau commented 5 years ago

Instead of typing

some_function()

and pressing return with my cursor in between the parentheses resulting in

some_function(
              )

would it be possible to do what Rstudio does and have it result in

some_function(

)

and put the cursor on the new blank line?

I prefer to write code that looks like this:

a_list <- list(
  a = c(1, 2)
  b = c("test")
)

as opposed to

a_list <- list(a = c(1, 2), 
               b = c("test"))

Thanks for a neat package!

randy3k commented 5 years ago

It is a general Sublime Text matter btw. You could ask the question on https://forum.sublimetext.com/ at your will.

hhau commented 5 years ago

Makes sense, thanks for the direction. I can get most of the behaviour I want with "indent_to_bracket" : false, and I think the rest of it I can pull out of the following stackoverflow links: https://stackoverflow.com/questions/29119887/sublime-pressing-enter-in-the-middle-of-a-bracket https://stackoverflow.com/questions/41456641/how-to-set-bracket-indentation-behavior-in-st3 https://stackoverflow.com/questions/22865347/smart-indenting-of-brackets-parenthesis-in-sublime-text-2#comment39926321_23672859

(For anyone's future reference).