R.nvim started as a translation of Vim-R, and this version 1.0.0 symbolically marks the completion of the transition process from VimScript to Lua. While the features of Vim-R were recreated, many new features were added, as (not exhaustively) detailed below.
Removed features
-
reStructuredText support (no longer seems to be widely used).
-
Legacy omni-completion (we now recommend the built-in LSP).
-
Highlighting functions from
.GlobalEnv(difficult to make compatible with
tree-sitter + LSP highlighting). -
The
echoargument for functions that send code to R console has been
removed. Users can still set thesource_argsto define the arguments that
will be passed tobase::source()and include the argumentecho=TRUE.
max_lines_to_pastecan now be used to set the number of lines which can be
sent directly to the R Console without saving the code in a temporary file. -
Rnoweb chunk headers with options are not supported by tree-sitter. You have
to write the options at the top of the code block after the#|comment
strings as is common in Quarto documents. See
execution-options. -
Integration with
Rappon macOS was removed (optionapplescript).
Changes
-
<M-->(i.e.Alt + -) is now used to insert<-. See the documentation
on how to create custom key bindings. -
R_sourceandafter_R_starthave been replaced with more powerfulhook
options. -
When running R in the Neovim built-in terminal or in a WezTerm split pane,
theR.nvimconfig optionrconsole_posshould be used to define the
position of the R Console. The Vim options 'splitright' and 'splitbelow' are
ignored. -
nvimpager, which controls how R documentation is displayed, now has
possible options"split_h","split_v","tab","float"(not
implemented yet), and"no". -
open_pdfreplacesopenpdfandopenhtml; see the documentation for
details. -
setwdreplacesnvim_wd. The new default value is"no". -
Only strings are valid values for
external_term. -
config_tmuxreplacesnotmuxconf. The new default value istrue. -
:RFormatnow requires {styler} to be installed; {formatR} is no longer
supported. -
Rout_optionsreplacesRout_more_colors. -
view_dfis a table replacing the optionscsv_app,
csv_delim, anddf_viewer. The commands to see adata.frame
ormatrixin a split window were eliminated. See the documentation
onview_dffor alternative ways of getting similar results. -
rmdchunkandrnowebchunkwere removed. In Insert mode, press<M-r>to
insert chunks of R code in Rmd, Quarto or Rnoweb. See the documentation on
how to create custom key bindings. -
In a Quarto or RMarkdown document, when the cursor is over a chunk header
and you try to send the current line and go to the next line, the whole
chunk is sent to R and the cursor jumps to the next chunk of either R or
Python code. -
Markdown documents are treated as RMarkdown if "markdown" is in
vim.g.R_filetypes.
New features
New filetype support
- Rtypst (
.Rtyp) documents are now supported: Typst files with R code chunks,
using the same chunk delimiters as Rmd and Quarto. Requires thetypst
tree-sitter parser.
New commands
-
:RMapsDescdisplays the list of key bindings followed by short
descriptions. -
:RConfigShowdisplays the list of configuration options and their current
values.
New keybindings
-
<LocalLeader>scsends a piped chain of commands. -
<LocalLeader>ipinstalls missing packages detected by
languageserver. -
<LocalLeader>spsplits a filepath under the cursor into individual
components concatenated using either"here::here"(the default),
"here","file.path","fs::path", or"path", depending on how
path_split_funis set. Requires
tree-sitter parsers to be installed. -
<LocalLeader>,inserts a pipe operator (|>).
New options
-
remote_compl_dirandremote_R_hostcontrol how to access a remote R from
a local Neovim. -
auto_quitcan be configured to automatically quit R when you quit Neovim. -
hookreplacesR_after_startandR_after_ob_open. -
rproj_prioritisecan be configured to control how.Rprojfiles change the
behaviour of R.nvim. Amongst other things, this may affect whether
<LocalLeader>,inserts|>or%>%. -
objbr_mappingscan be configured to run R commands on objects in the
current session. -
pipe_versionallow you to choose between "native" or "magrittr". -
external_termnow accepts as valid values"wezterm_split"and
"kitty_split", not requiring Tmux to split the terminal window.
It's possible to WezTerm to run R in an external
terminal emulator on Windows. Hence, the values"wezterm"and
"wezterm_split"are valid on Linux, macOS and Windows. -
objbr_mappingsadds custom keymap to the Object Browser. -
objbr_placeholderdefines the string to substitute for with objects. -
R-language-serversets options for R.nvim's built-in language server. -
max_paste_linessets the maximum number of lines to be pasted into R
Console. -
debugenables support for debugging functions. -
chunk_langschanges configuration for code chunk languages.
Contributors
Adam K. (@akthe-at)
aloha (@alohaia)
Anas sheashaey (@she3o)
Ben Puryear (@Ben10164)
Christopher Swingley (@cswingle, @cswingley)
Clark Richards (@richardsc)
Daniel Hermosilla (@DanielHermosilla)
Guilherme D. Garcia (@guilhermegarcia)
Hongyuan Jia (@hongyuanjia)
Iakov Davydov (@idavydov)
Jacob Scott (@wurli)
Jacques-z (@Jacques-z)
Jakson Alves de Aquino (@jalvesaq)
James Eapen (@jamespeapen)
Jason Pott (@jasonpott)
Johannes Bezold (@johannesbzd)
Johannes Ranke (@jranke)
Justin Wishart (@jrwishart)
j-w-e (@j-w-e)
LiuBianShi (@liubianshi)
Marcel Schilling (@mschilli87)
Michael McLaren (@mikemc)
oliwia (@kkanden)
Peter Pavicic (@PeterPavicic)
Philippe Massicotte (@PMassicotte)
Robert Castelo (@rcastelo)
Ryan Dale (@daler)
Spencer Britten (@smb5)
Tod Morrison (@todmorrison)
Urtzi Enriquez-Urzelai (@urtzienriquez)
Wojtek Klimowicz (@wklimowicz)
Yun Jiang (@jiangyun-fun)