Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions doc/R.nvim.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1338,8 +1338,8 @@ values:
max_time = 100,
},
<
You should increase the value of `max_list_len` if you want to be able to open in
the Object Browser and do completion of list and S4 objects with more than
You should increase the value of `max_list_len` if you want to be able to open
in the Object Browser and do completion of list and S4 objects with more than
10000 elements. You should increase the value of `max_depth` if you want to
complete or see in the Object Browser more than 3 list levels. You should
increase either `max_size` or `max_time` if `nvimcom` needs more space or more
Expand All @@ -1349,6 +1349,21 @@ this case, please, put `options(nvimcom.verbose = 1)` in your `~/.Rprofile`
and use the information output by `nvimcom` to decide what parameter to
change.

Completion lists are built in parallel, using all but two of the cores
reported by `parallel::detectCores()`. On systems where this number does not
reflect the resources actually available to the process, like an HPC
cluster where CPUs are allocated as portions of the total available on the hardware,
you can cap the number of cores with the `nvimcom.max_cpu_cores` option in your ~/.Rprofile:
>r
options(nvimcom.max_cpu_cores = 4)

This value can come from environment variables. For example, on an HPC cluster using
the Slurm scheduler, you can set the option to the value of the environment variable `SLURM_CPUS_PER_TASK` or, if it's not available (for example, you have not specified
`cpus-per-task` for the job and only get the default number of CPUs), then fall back to 2:

>r
options(nvimcom.max_cpu_cores = max(2, as.numeric(Sys.getenv("SLURM_CPUS_PER_TASK"))))

Comment thread
PMassicotte marked this conversation as resolved.
It is possible to add a custom keymap through `objbr_mappings` table. The
keymap defined in this table will be available in the object browser only.
Using this method, you can set keymaps that run Lua functions or R code. The
Expand Down
4 changes: 2 additions & 2 deletions nvimcom/DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: nvimcom
Version: 0.9.95
Date: 2026-06-04
Version: 0.9.96
Date: 2026-06-16
Title: Intermediate the Communication Between R and Neovim
Authors@R: c(
person("Jakson", "Aquino", email = "jalvesaq@gmail.com",
Expand Down
6 changes: 5 additions & 1 deletion nvimcom/R/bol.R
Original file line number Diff line number Diff line change
Expand Up @@ -690,7 +690,11 @@ nvim.build.cmplls <- function() {
flush(stdout())
}

num_cores <- max(c(parallel::detectCores() - 2, 1))
if (is.null(getOption("nvimcom.max_cpu_cores"))) {
num_cores <- max(c(parallel::detectCores() - 2, 1))
} else {
num_cores <- getOption("nvimcom.max_cpu_cores")
}
invisible(parallel::mclapply(1:nrow(b), process_row, mc.cores = num_cores))

return(invisible(0))
Expand Down
Loading