Skip to content

Commit

Permalink
vscode settings.json
Browse files Browse the repository at this point in the history
  • Loading branch information
KasperSkytte committed Nov 7, 2024
1 parent 90abaad commit 94f9a7c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/software/conda.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,15 @@ Be aware that specific versions are specified using double `==` with `pip` depen
Use the notation `r-{package}` to install R and required R packages within an environment, see the list of packages [here](https://anaconda.org/r/repo?sort=_name&sort_order=asc). Alternatively using [renv](https://rstudio.github.io/renv/articles/renv.html) is **highly recommended** for project reproducibility and portability if you need to install many packages.

## VS Code and conda environments
To ensure VS Code uses for example R and Python installations in conda environments, you can make a file `.vscode/settings.json` in the project folder and write for example:
To ensure VS Code uses for example R and Python installations in conda environments, you can make a file `.vscode/settings.json` in the current project folder and write for example:
```shell
{
"r.rterm.linux": "${userHome}/.conda/envs/myproject/bin/R",
"python.defaultInterpreterPath": "${userHome}/.conda/envs/myproject/bin/python"
}
```

You can also place the `settings.json` file at `$HOME/.config/Code/User/settings.json` instead to make the settings apply for **all** projects. If any `.vscode/settings.json` files are present in individual project folders, they will take precedence over `$HOME/.config/Code/User/settings.json`.

Read more details [here](https://code.visualstudio.com/docs/python/environments).

0 comments on commit 94f9a7c

Please sign in to comment.