Comments (5)
This is something I've wanted as well. I have a fork that does something like this. It sets the working directory to the project directory every time you send a command.
https://github.com/hafen/R-Box
You can see the relevant changes in rbox/send_text.py at the bottom of here:
The way you activate it is to set a project variable "R_box_setwd" to true. So your x.sublime-project file might look something like this:
{
"folders":
[
{
"follow_symlinks": true,
"path": "."
}
],
"settings":
{
"R_box_setwd": true
}
}
This is pretty unobtrusive but I haven't gotten around to doing a PR for it.
from r-box.
Not sure if I follow, but is what you are looking for different than CMD+\
?
from r-box.
First create a project in Sublime Text in a folder foo.
Open a file, as R extended (even without saving the file).
In REPL R, thanks to the setting that I mentioned above, by default the current working directory (cdw) is set to the level of the folder foo.
It makes Sublime Text work with projects in the same way as Studio does.
The setting of wd is totally transparent to the user and I can refer to any subfolder with indirect addressing, e.g. ./data/somefile.csv
without ever having to use setwd("a/very/long/directory/name")
, which is not portable etc.
@hafen code (that I confess I haven't tried yet but is on my todo list!) should be doing something similar for R terminal (i.e. when we send the code to the R UI): automagically the wd is set to the folder level.
I have never used CMD+\
but it seems to be trying to save a file?
from r-box.
@smartinsightsfromdata
where did you add that pref? and at what point does it change directory? when ou open a project?
I modified my R-box user setting to:
{
"prog": "SublimeREPL",
"cwd": "$folder",
}
i'm not getting anything different.
The problem with CMD+\ is it uses the source files directory. I usually keep my project-template file in projectdir, in the below structure. in fact, is there a way to turn it off because I hit \ accidentally all the time.
projectdir/
src/
data/
from r-box.
Sending code feature is exported to SendREPL.
Please open an issue there at your will.
from r-box.
Related Issues (20)
- Pipe (%>%) is treated as LaTeX comment in R Sweave files HOT 2
- Format Code is capturing text from `.Rprofile` and `.First()` output HOT 5
- Auto Completion not working on installed packages? HOT 1
- Fresh install: ImportError: No module named 'yaml' on MacOS High Sierra HOT 1
- format code doesn't work on Mac and Ubuntu HOT 2
- Error in R Sweave syntax HOT 4
- R-box menu items about package install, test, build not work in windows HOT 5
- autocomplete suggestion
- cannot install R-BOX HOT 2
- Uninstalling R-Box doesn't remove top menu items HOT 2
- feature request: more bookdown support, in particular `footnote` ^[Footnote text]` HOT 4
- Highlighting function names in default R syntax HOT 2
- Rbox cant find R
- r-box popup hints not shown HOT 4
- Set Working Directory does not work HOT 6
- Building sweave documents written in UTF-8 encoding HOT 2
- R-box does not contain R extended HOT 1
- R-box crashes plugin-host, for some R source files HOT 1
- Setting LC_ALL doesn't work for R-Box
- R-box can't send code to sublimerepl
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from r-box.