Skip to content

Instantly share code, notes, and snippets.

@eliardocosta
Last active July 28, 2017 20:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eliardocosta/208f64ff0e39bde4e0f2a0a390316521 to your computer and use it in GitHub Desktop.
Save eliardocosta/208f64ff0e39bde4e0f2a0a390316521 to your computer and use it in GitHub Desktop.
Adding a snippet to insert 0BSD License header in RStudio scripts.

1- Go to Tools -> Global Options -> Code -> Snippets -> Edit Snippets.
2- Then paste the following code:

snippet 0bsd
	`r paste('#  script.R')`
	`r paste('#')`
	`r paste('#  Copyright (c)', format(Sys.time(), "%Y"), '<Your name>')`
	`r paste('#')`
	`r paste('#  This program is free software; you can redistribute it and/or modify')`
	`r paste('#  it under the terms of the BSD Zero Clause License as published by')`
	`r paste('#  Rob Landley. See http://spdx.org/licenses/0BSD.html for more details.')`
	`r paste('\n')`

To use this snippet in the script type 0bsd then Shift+Tab.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment