Pass a string to be executed as a Vim command in the RStudio source editor. This function then sends the input key presses to type out the command.
Conditions
Vim keybindings must be enabled and you must have a file open at the front in
the source editor so that you could execute the commands if you moved focus
to source yourself. It will error with a different at the front like a
View()
tab.
See also
rsvim_exec_file()
to run all commands from a config file.
Examples
if (FALSE) { # \dontrun{
#' # Create a home-row binding jk to go from insert mode to normal mode.
rsvim_exec("imap jk <Esc>")
# Replace "text" with "rep" everywhere in the active document.
rsvim_exec("%s/text/rep/g")
# Bring up RStudio's Vim help (see Ex Commands for other commands)
rsvim_exec("help")
} # }