Skip to content

Commit

Permalink
Change default value of setwd "no"
Browse files Browse the repository at this point in the history
Close #75
  • Loading branch information
jalvesaq committed Mar 8, 2024
1 parent cf40f9d commit fa71b7d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ The options `openpdf` and `openhtml` were renamed as `open_pdf` and
`open_html`, they now are strings and there with a minor change in how they
behave.

The option `nvim_wd` was renamed as `setwd` and it now is a string.
The option `nvim_wd` was renamed as `setwd` and it now is a string and its
default value is "no".

There are two new commands:

Expand Down Expand Up @@ -140,7 +141,7 @@ None yet. Tell us if published a video presenting R.nvim features.
The diagram below shows how the communication between Neovim and R works.
![Neovim-R communication](https://raw.githubusercontent.com/jalvesaq/tmp-R-Nvim/master/nvimrcom.svg "Neovim-R communication")

The black arrow represents all commands that you trigger in the editor and
The black arrows represent all commands that you trigger in the editor and
that you can see being pasted into R Console.
There are three different ways of sending the commands to R Console:

Expand Down
19 changes: 6 additions & 13 deletions doc/R.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1527,23 +1527,16 @@ higher value for the variable in your config. Example:
------------------------------------------------------------------------------
6.27. Start R in working directory of Neovim *setwd*

When you are editing an R file (.R, .Rnw, .Rd, .Rmd, or .qmd) and start R, the
R package nvimcom runs the command `setwd()` with the directory of the file
being edited as argument, that is, the R working directory becomes the same
directory of the R file (option `setwd` = "file"). If you want R's working
directory to be the same as Neovim's working directory, put in your config:
If you want that R starts in the directory of the file that you are editing,
put in your config:
>lua
setwd = "nvim"
setwd = "file"
<
This option is useful only for those who did not enable 'autochdir'.

If you prefer that R.nvim does not set the working directory in any way, put
in your config:
If you want that R starts in Neovim's working directory, put in your config:
>lua
setwd = "no"
setwd = "nvim"
<
The workding directory is not set when running R in a remote machine from a
local Neovim.
The default value of `setwd` is "no". See also 'autochdir'.


------------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion lua/r/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ local config = {
max_paste_lines = 20,
min_editor_width = 80,
non_r_compl = true,
setwd = "file",
setwd = "no",
nvimpager = "split",
objbr_allnames = false,
objbr_auto_start = false,
Expand Down

0 comments on commit fa71b7d

Please sign in to comment.