Closed mschmidty closed 1 month ago
Perhaps, @akthe-at can help you...
Thanks @jalvesaq ... Hi @mschmidty , is this a new issue for you? Have you ever successfully run R.nvim before or your first attempt at setting it up?
I think it might be helpful for us to debug this issue if you showed us your config for R.nvim as well.
If my memory serves me correctly, I might have had this issue when I didn't have the right tooling to allow nvimcom to build correctly and I needed to make sure gcc was available on my PATH.
I appreciate your response.
I have not gotten R.nvim running on my windows machine (work, and the reason for the current issue), but I do have it running on my Mac (personal) with the same config.
My config is basically just the default:
require('lazy'). setup({
--other plugin config
{
'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
opts = {
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'vim', 'vimdoc', 'markdown_inline', 'r', 'rnoweb' },
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = { 'ruby' },
},
indent = { enable = true, disable = { 'ruby' } },
},
config = function(_, opts)
require('nvim-treesitter.install').prefer_git = true
require('nvim-treesitter.configs').setup(opts)
end,
},
{
"R-nvim/R.nvim",
lazy = false
},
"R-nvim/cmp-r",
{
"hrsh7th/nvim-cmp",
config = function()
require("cmp").setup({ sources = {{ name = "cmp_r" }}})
require("cmp_r").setup({ })
end,
},
})
-- with treesitter config elsewhere
I'm pretty new to neovim and vim in general so I've been using the kickstart nvim init.lua.
I think it is a proxy issue because a window popped up the first time I tried to run R.nvim but I have not seen it since the first time.
gcc seems to be in my path:
❯ which gcc
/c/msys64/ucrt64/bin/gcc
Hey Mike welcome to the neovim community! I am also forced to use Windows for my work computer so I know how you feel. I am going to copy and paste my R.nvim config for you.
I think the big piece that you need to try and add to get it to work is the R_path in opts. I don't think anything else in my console is imperative but its easier to copy and paste the entire thing and might give you ideas of things to modify.
Feel free to delete it all except the R_path which obviously needs to be modified to match your own
{
"R-nvim/R.nvim",
ft = { "r", "rmd", "rout" },
opts = {
R_path = "C:\\Users\\ARK010\\AppData\\Local\\Programs\\R\\R-4.3.3\\bin\\x64", --I found that / and \\ both work here.
-- ^^ Also make sure this file path is available on your PATH ^^
open_html = 1,
objbr_auto_start = true,
objbr_opendf = 1,
objr_place = "console, below",
open_pdf = 0,
hl_term = true,
OutDec = ",",
close_term = true,
nvim_pager = "tab",
pdfviewer = "sumatrapdf",
},
config = function()
vim.g.R_bracketed_paste = 0
vim.g.R_args = {}
vim.g.rout_follow_colorscheme = false
if vim.o.termguicolors then
vim.g.rout_color_input = "guifg=#f265b5"
vim.g.rout_color_normal = "guifg=#10A1BD"
vim.g.rout_color_number = "guifg=#c0c95f"
vim.g.rout_color_integer = "guifg=#c0c95f"
vim.g.rout_color_float = "guifg=#c0c95f"
vim.g.rout_color_complex = "guifg=#c0c95f"
vim.g.rout_color_negnum = "guifg=#a48cf2"
vim.g.rout_color_negfloat = "guifg=#a48cf2"
vim.g.rout_color_date = "guifg=#37f499"
vim.g.rout_color_true = "guifg=#37f499"
vim.g.rout_color_false = "guifg=#ff5d5e"
vim.g.rout_color_inf = "guifg=#04d1f9"
vim.g.rout_color_constant = "guifg=#39DDFD"
vim.g.rout_color_string = "guifg=#37f499"
vim.g.rout_color_error = "guifg=#ffffff guibg=#f0313e"
vim.g.rout_color_warn = "guifg=#f0313e"
vim.g.rout_color_index = "guifg=#d0d080"
end
end,
}
@akthe-at Thanks Adam. I'm happy to be dipping my toes into neovim.
R_path
was it. I added the R_path
and made sure it was in my $PATH
and R started right up.
Thank you so much! I really appreciate the help.
Awesome, please feel free to reach out for any help you might need. Windows & Neovim isn't everyone's first desired mix but it is definitely doable and enjoyable once it is setup!
Thanks for taking the time to clarify that the path variable needs to explicitly stated in the configuration for R.nvim.
Thanks for taking the time to clarify that the path variable needs to explicitly stated in the configuration for R.nvim.
You have to remember to update the R_path
after upgrading R while, ideally, R.nvim
would be able to find the R path in the Windows registry.
When I run R /rf, it flashes a new buffer that closes immediately, and then gives an error message that says: The package nvimcom wasn't loaded yet. Please, quit R and try again. I believe this might be because running a server may be blocked but I am unsure.
Running
:RDebugInfo
produces: