Closed mschubert closed 10 months ago
Nvim-R is an old plugin configured by global variables that must be set before its code is sourced. So, what happens if you try this before lvim.plugins{}
:
vim.g.R_assign = 0
vim.g.R_app = "radian"
vim.g.R_cmd = "R"
Thanks for the quick answer!
I already tried this (see lines 1-3 above) and it doesn't solve the issue, unfortunately.
I installed LunarVim and couldn't replicate the bug. I don't have radian
installed, but I created a symbolic link to R
named "radian"; I also tried a symbolic to bash
named "radian". In both cases, :RDebugInfo
shows the expected output before starting R (R_before_nrs
is R_cmd
). Of course, nothing works after starting bash
instead of R
, but it's clear that the values of R_app
and R_cmd
defined in the config.lua
are respected. The config you posted when opening the issue works, but, because you repeat the same configuration three times, of course, at least one of them works and the other two either work or are harmless. More precisely, the first two work and the third one (lvim.lang
) does nothing.
I'm getting the following :RDebugInfo
, I guess there is some kind of error (RInitErr
)?
RInitOut
nvimcom_info
version: 0.9-161
home: /home/mschu/R/x86_64-pc-linux-gnu-library/4.3/nvimcom
Rversion: 4.3.2
RInitErr
Time
R_before_nrs: 0.160372
start_nrs: 0.001711
common_global: 6.84731e-4
There is no error. RInitErr
is the stderr
output of R_before_nrs
. It's empty because there was no output to stderr
. And even if there was output, it could be only informational. I will change the names of the fields of :RDebugInfo
...
Oh no - I just realize, I made a mistake here: The command indeed already started radian
, but I mistook it for R
because I didn't set g:R_hl_term = 0
.
So everything works, sorry for the nuisance!
No problem. This was an opportunity to improve :RDebugInfo
...
I've tried multiple ways of setting the options
R_app
,R_cmd
in LunarVim's~/.config/lvim/config.lua
. However, every time I start with<Leader>rf
, it startsR
instead ofradian
:R_assign = 0
is respected and the<C-Space>
mapping works as well. I've tried each way of setting theR_app
andR_cmd
options separately, which also does not work.If I remove
R_cmd = "R"
, I do get the startup errorwhere
:RDebugInfo
statesso the option does seem to get set, expect that
R
gets started instead ofradian
as soon as I setR_cmd
.I don't know if I'm approaching this the wrong way or what else might be happening.