Skip to content

Add edit_rstudio_prefs? #1148

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
boshek opened this issue Jun 1, 2020 · 3 comments
Closed

Add edit_rstudio_prefs? #1148

boshek opened this issue Jun 1, 2020 · 3 comments
Labels
edit 🧞‍♂️ feature a feature request or enhancement

Comments

@boshek
Copy link
Contributor

boshek commented Jun 1, 2020

Would an edit_rstudio_prefs function be useful here?

Here is a minimal function that might be a start cribbed heavily from edit_r_profile:

edit_rstudio_prefs <- function(){
  if( .Platform$OS.type == "windows") {
    path <- glue::glue("{Sys.getenv('APPDATA')}\\RStudio\\rstudio-prefs.json")
  }
  
  if( .Platform$OS.type == "unix") {
    path <- "~/.config/rstudio/rstudio-prefs.json"
  }
  
  usethis::edit_file(path)
  usethis::ui_todo("Restart RStudio for changes to take effect")
  invisible(path)
}

edit_rstudio_prefs()

Just trying to gauge whether there is interest in working on this to include into usethis.

@jennybc
Copy link
Member

jennybc commented Jun 1, 2020

Yeah now that RStudio affords better control over all of this, we will definitely take advantage. I haven't given it any specific thought yet, personally.

Existing function that is also relevant: use_blank_slate(). In the past, we couldn't really do much exciting there -- which is to change this at the user level (vs. project) only -- but now I think we can.

@jennybc
Copy link
Member

jennybc commented Jun 1, 2020

Note we would never want to hardwire any more path logic than we have to. I'd rather ask rstudioapi where it keeps it config file. Which is an existing request of mine:

rstudio/rstudioapi#176

@jennybc jennybc added edit 🧞‍♂️ feature a feature request or enhancement labels Jun 1, 2020
@jennybc
Copy link
Member

jennybc commented Aug 26, 2020

Maybe we can use rappdirs to get around the path problem, since RStudio >= 1.3 complies with the XDG base directory standard for configuration data:

https://github.com/r-lib/rappdirs

hadley added a commit that referenced this issue Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
edit 🧞‍♂️ feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants