README.md

RStudio snippets

CRAN version

The package:snippets enables you to (add/remove/read) snippets programmatically.

Usage: (assigning a keyboard shortcut is recommended, see: "Combining with keyboard shortcuts:")

alt text

Via code:

addSnippet("test", "print('This is long code i dont want to retype everytime')")
readSnippet("test")
snippet test
    print('This is long code i dont want to retype everytime')
removeSnippet("test")

Installation

For latest development version:

devtools::install_github('Timag/snippets')

Combining with keyboard shortcuts: alt text

(Usual way so far is to access RStudio snippets via: RStudio - Tools - Global Options - Code - Edit Snippets...)

Open issues:

Snippets seem only to be updated if r.snippets file will opened afterwards (in RStudio). As a workaround i call file.edit("~/.R/snippets/r.snippets") at the end of the functions.



Timag/snippets documentation built on May 5, 2019, 2:44 a.m.