gadenbuie / shrtcts

Make Anything an RStudio Shortcut
https://pkg.garrickadenbuie.com/shrtcts/
Other
119 stars 4 forks source link

locating configuration files #21

Closed shannonpileggi closed 2 years ago

shannonpileggi commented 2 years ago

Hi Garrick! Thank you for this awesome package!

I am a Windows user, and struggling a bit with the configuration files. fs::path_home(), fs::path_home_r() yield two different locations for me. The one {shrtcts} seems to be happy with corresponds to fs::path_home_r(), and so I was able to create the .shrtcts.R with

fs::file_create(fs::path(fs::path_home_r(), ".shrtcts.R"))
fs::file_show(fs::path(fs::path_home_r(), ".shrtcts.R"))

and now the initial chatter about Could not find .shrtcts.R or .shrtcts.yaml... has been resolved. 😊

But now when I run shrtcts::locate_addins_json() I get

Error: Could not find addins.json in the usual places. You may need to manually create a new keyboard shortcut (use RStudio's Tools menu) first.

And I can't quite figure this one out. I see in the documentation that it is typically stored in ~/.config/rstudio/keybindings (>= 1.3) or ~/.R/rstudio/keybindings (< 1.3)

But I cannot locate this file. Is this a file that has already been created that I need to find and set the path to? Or is this a file that I have not yet created and I need to create?

Any help would be much appreciated. Thank you!

gadenbuie commented 2 years ago

What the error message is trying to say but is a bit terse and unclear is that if the file is missing it might be that you haven't created any custom shortcuts in the IDE yet. So you might need to go into the shortcuts menu and make at least one shortcut or modify an existing one. When you do that, the IDE should create the file you need.

If that doesn't work, then there's either a bug in my code or the location of the file has changed. In either case, if you get to that point, it'd be helpful if you could share the output of

rstudioapi::versionInfo()
devtools::session_info()
shannonpileggi commented 2 years ago

Yes, that was it, thank you for explaining. After I modified an existing shortcut and re-started my computer πŸ˜… the new shrtct started working! πŸ˜€ It is a great addtion to my workflow, thank you again! πŸŽ‰

gadenbuie commented 2 years ago

Awesome, thank you! And glad to hear it's all working nicely now! πŸ˜„