Hi Rstudio Community,
Crosspost on R4DS
Is anyone aware if functionality exists within RStudio to select all code between curly braces / parentheses, and if so what it is called so I can keybind it? If it doesn’t exist, does anyone know how to get it through an add-on?
I know that double-clicking in between curly braces will highlight everything plus the last curly-brace and that's close but I'm looking for a keybinding to highlight everything within the curly braces or parentheses which the cursor is placed within. (Unrelatedly, why does it highlight that last curly brace, I can't imagine anyone wants the brace itself highlighted in addition to the code?)
If it's not possible to add this functionality as an add-on, how would I submit a feature request for Rstudio Devs to add this functionality as a source editor feature?
You're maybe looking for Expand Selection?
This command selects everything within the current set of pairs -- where "pairs" is braces, parens, quotes, etc. You can hit it repeatedly to grow your selection outward.
If that doesn't do exactly what you want, you could indeed write an add-on to do what you're describing. Check out the selection range API:
That's exactly it! Thank you!
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.