fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

10K
active users

Jim Gardner

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…

@ktaylor Is this a cry for help, Kevin? 😆

@jimgar Learning #vim is a great investment, imo, if you have a few years available. I cannot recommend emacs keybindings because you specified "comfort-boosting"...

@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.

@jimgar @ktaylor I do use emacs, but with evil mode (aka as "vim mode") 😂

Vim is incredibly useful, it's hard to explain how much better Vim's modal mode is compared to "traditional" editors. And what's neat is that you can already benefit a lot from learning just some basics.

@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: tidytales.ca/series/2023-01-24

tidytales.caTidy TalesWrangling, Visualizing, Modelling, Communicating data

@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 🙌🏻