You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, not sure if this is possible. Sometimes I'd like to retain the (lack of) line breaks for certain lines of R code, because I think it's easier to read. I've learned how to set the style using options(styler::tidyverse_style(scope = I(c('spaces','indention','tokens')))), but it would be great to have a dedicated keyboard shortcut for styling a selection of code with this specified style. Then I can use one shortcut for invoking style_selection with the default tidyverse style, and another keyboard shortcut for invoking style_selection with the no-breaks tidyverse style.
Possible?
The text was updated successfully, but these errors were encountered:
Hi, I am not sure that's easily possible due to {rstudioapi} current functionality. Technically, I think we could expose multiple addins and allow the user to parametrise each of them with a style guide (instead of relying on the options). Or make the behaviour of the styling addin dependent on some environment / option value. But I consider that out of scope for {styler.}. Also, consider using {codegrip}.
Understood. Thanks for clarifying. I suppose I'll look into trying to achieve your first idea, with distinct addins for different styles that I can bind to different shortcuts. I looked at codegrip, but I didn't see anything that might be useful for this.
Hi, not sure if this is possible. Sometimes I'd like to retain the (lack of) line breaks for certain lines of R code, because I think it's easier to read. I've learned how to set the style using
options(styler::tidyverse_style(scope = I(c('spaces','indention','tokens'))))
, but it would be great to have a dedicated keyboard shortcut for styling a selection of code with this specified style. Then I can use one shortcut for invoking style_selection with the default tidyverse style, and another keyboard shortcut for invoking style_selection with the no-breaks tidyverse style.Possible?
The text was updated successfully, but these errors were encountered: