snippr (version 0.0.0.9000)

snippets_install_gist: Install one or more snippets from a GitHub Gist

Description

Install one or more snippets uploaded as a GitHub Gist

Usage

snippets_install_gist(gist, name = NULL, language = "r",
  path = snippets_path(language))

Arguments

gist

Identifier of the gist. For example, if the gist is https://gist.githubusercontent.com/dgrtwo/ecc6aec8d37af42cdd83, then the gist ID would be 'ecc6aec8d37af42cdd83'.

name

name of snippet to install. If NULL, installs all snippets from the Gist.

language

language of the snippet. Choices are "r", "c_cpp", "html", "css", "java", "javascript", "python", and "sql". Ignored if path is specified.

path

path to .snippets file

Details

Note that a .snippets file for a language may not yet exist. If it does not exist, go to Preferences->Code->Edit Snippets in RStudio, make a trivial change to the language of choice (for example, a new empty line), and click Save. This will create the language file in ~/.R/snippets/<language>.snippets with defaults included.

Examples

Run this code
# NOT RUN {
snippets_install_gist('ecc6aec8d37af42cdd83')
# }

Run the code above in your browser using DataLab