Any recommendations of comfort-boosting keyboard shortcuts in RStudio, for beginner and intermediate users?
Currently whipping up a blog post. Got stuff like multiple cursors/carets, moving around on lines, find/replace, search in files, assignment & pipe operators.
@superboreen Shit. I don’t think I’ve ever seen this very cool! In it goes…
@jimgar I use the VIM keybindings.
@ktaylor Is this a cry for help, Kevin?
@ktaylor Haha. I think maybe @brodriguesco uses emacs All joking aside, what are the benefits of using vim key bindings in RStudio? Knowing said key bindings if you find yourself stuck somewhere with just vi or vim available? Transferability to other languages and IDEs? Assuming that someone is not already familiar with vim as an editor.
@brodriguesco @ktaylor Thanks Bruno! What a darling, evil man you are.
@brodriguesco @jimgar Yeah, completely agree. Most high-quality text editors have vim keybindings too, so once you learn them they are pretty transportable.
@jimgar ctrl + shift + R to create a new section comment. Useful to navigate long scripts.
@jospueyo Interesting one, thanks Josep!
@jimgar For Quarto and R Markdown:
- Cmd+Alt+I makes an empty code chunk
- For anyone doing writing where you need to cite things from your Zotero library, the (custom) citation shortcut is also super helpful: https://tidytales.ca/series/2023-01-24_reproducible-data-science/posts/zotero-setup#using-zotero-for-citations-in-quarto-and-r-markdown-documents
@mccarthymg 100% on the code chunk one. I’ll peep the Zotero link - my academia days are long gone but I know it is an indispensable tool and must be useful for literate programming. You’ve also inadvertently reminded me about the codegrip “reshape expression” addin, I will add that too!
@jimgar It’s very useful—the shortcut brings up a search box for my Zotero library, then once I search and select the references I want it inserts their citation keys into the document in the correct order. Such a time saver!
@jimgar Learning the shortcut to move the current line up or down in a script was a huge help for me.
@elipousson which one is that specifically Eli? Do you reckon itself a beginner/intermediate one? I’ve yet to use the ‘move line’ types, so am wondering if it’s actually more of an advanced productivity thing or am I just a clicker at heart (strong likelihood)
@jimgar I checked today and found it is just holding down the option key while using the up and down arrows. I’ve added the same shortcut to Obsidian since it is also handy for note-taking and to-do lists.
It wouldn’t be the first keyboard shortcut I’d try to learn but, especially for anyone already using pipes, it is so helpful for changing the order of execution within a script.
@elipousson As it happens, I started to use it after your previous toot in this thread. I had 3 short bullet lists of ~ 5 items each. Used it to invert the order and it was indeed super fast. I’ll consider adding it along with a couple of other ones people have suggested