Skip to contents

Checks against the RStudio defaultExCommandMap in keybinding-vim-uncompressed.js. The list is not complete and doesn't include for example :help and :R.

Usage

rsvim_is_valid_command(command)

Arguments

command

String. Command to check for validity.

Value

Logical. Whether the command is supported in RStudio's javascript implementation of Vim.

See also

rstudio_vim_commands for all valid commands.

Examples

# valid commands
rsvim_is_valid_command("map")
#> [1] TRUE
rsvim_is_valid_command("noremap")
#> [1] TRUE

# not valid commands
rsvim_is_valid_command("hello")
#> [1] FALSE

# it is not a complete list at present:
rsvim_is_valid_command("help")
#> [1] FALSE