Managing snippets

I have a ton of snippets saved in github gists. The issue is there are a lot of them and github search is not very usable when I need a chunk of code to insert into my RStudio.

How do you manage your snippets? Any tool or suggestion, even using the snippets option in RStudio (not very suitable to my needs in my humble opinion) is welcome

Check out snippr, a package to "manage, share, and install RStudio code snippets"

I mainly use it because I switch computers ~regularly, and like to keep my snippets synchronized.


Thanks a lot Mara, very useful

1 Like

Tried but sadly, seems that is useful for saving and sharing snippets only. My exact need is the opposite, having a bunch of snippets, choose one and insert it in my the most simple way. This forces me to get the unique ID from a gist, very convoluted procedure

Take a look at this gorgeous snippet/Gists manager

Ah, I think I understand now. So, basically, an interface for navigating your files here:

yep, an easy way of organising snippets by category (maybe nodes in a tree) and just click on one of them and then appeared the chunk in my Rscript

Do your snippets make use of the auto-fill/select and cursor-placement features (e.g., ${1:dataset} in Mara's aa snippet, above), or are they more like plain chunks of boilerplate or example solutions to specific problems? Or a mixture of both?

A mixture of both
Some just code and some more interactive