convert text case in text editor via keyboard shortcut

In sublime text editor I can highlight text and then change its capitalization via keyboard shortcuts like "cmd+k, cmd+u" --> uppercase. Is there any equivalent functionality in RStudio's text editor? It's a workflow disruption to copy text to console for a toupper('my string') and then copy paste it back to my editor.

It's a good idea. I'm not aware of a built in way to do this but it's the perfect job for an add-in. I searched quickly for an existing add-in that does this but didn't find one - you might.

Anyway it's not too difficult to write your own add-in. See my recent comment here on another thread - use the rstudioapi package to see how to access selected text.

See also this blog post

Yes, you'll need to do this with an add-in -- unless you use the Vim keybindings! With Vim keybindings on, pressing ~ in Command mode will invert the case of the selection.

1 Like

This topic was automatically closed 21 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.