Can you change the directory the Rstudio looks for the r.snippets file?

I have just discovered Rstudio's snippet autcomplete functionality and I love it, thanks R studio! I've made some custom snippets for myself, but I'd really like a way to share them with my team. I know they can copy the file onto their machines, but I'm wondering if there's a way to place the r.snippets file on a shared drive, or even better, in a git repository? The problem I'm having is that under Tools -> Global Options -> Code -> Edit Snippets I can't see a way to change the path to the file.

Any help would be much appreciated

Thanks

1 Like

While that directory isn't currently configurable, you might have luck creating a symbolic link (or, on Windows, a junction point) to re-route the snippets directory to another location.

Thanks so much for you response Kevin. It worked. In case others will find it useful I'll just detail what I did, on Windows:

  1. Put you existing r.snippets file in the new directory on the shared drive. I called mine 'snippet files'
  2. Delete the snippets directory which is inside the .R directory
  3. Run cdm as an administrator.
  4. Enter the command mklink /D "C:\Users\name.surname\Documents\.R\snippets" "T:\shared directory\snippet files"
  5. Restart Rstudio.

Thanks again :grinning:

3 Likes

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.