Skip to content

Instantly share code, notes, and snippets.

@djnavarro
Created June 24, 2021 11:30
Show Gist options
  • Save djnavarro/0fa53868439f8db604fcd23bbef01288 to your computer and use it in GitHub Desktop.
Save djnavarro/0fa53868439f8db604fcd23bbef01288 to your computer and use it in GitHub Desktop.
my .Rprofile settings
if(interactive()) {
cat("\014") # clear screen
cli::cli_text("")
cli::cli_text(R.version$version.string)
cli::cli_text("")
cli::cli_alert_success(
paste0(
"Alcohol free for ",
lubridate::today() - lubridate::dmy("2 jul 19"),
" days"
)
)
cli::cli_alert_success(
paste0(
"Cigarette free for ",
lubridate::today() - lubridate::dmy("21 jun 21"),
" days"
)
)
# packages I use interactively
suppressMessages({
require(devtools)
require(usethis)
require(testthat)
require(roxygen2)
require(pkgdown)
})
# customise the prompt
prompt::set_prompt(function(...){
branch <- (purrr::safely(gert::git_branch))()
if(is.null(branch$result)) return("> ")
return(paste0("[", branch$result, "] > "))
})
# usethis options
options(usethis.protocol = "ssh")
options(usethis.full_name = "Danielle Navarro")
# bias against scientific notation
options(scipen = 4)
# hey gurl
cli::cli_alert_success(paste("Hey gurl!", intToUtf8(127752)))
cli::cli_text("")
}
@PythonCoderUnicorn
Copy link

I used this code and modified it, works like a charm. Thanks for sharing. (I also Tweeted my working example which you saw :) )

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