Skip to main content
Version: Next

Configuration

Rsvim uses javascript/typescript scripts to configure its behavior, script drives everything.

Config Home and Entry Point

At startup, Rsvim chooses a local directory as its config home, and a rsvim.js (or rsvim.ts) file under that directory as the entry point.

The entry point script will be executed to apply all configurations.

Candidate Locations

Rsvim tries to find its config home in following 3 locations in turn, picks the first that meets the requirements.

$XDG_CONFIG_HOME/rsvim/

First it tries to find whether the FreeDesktop Directory Specification directory and entry file exist:

  • Config home: $XDG_CONFIG_HOME/rsvim/
  • Config entry: $XDG_CONFIG_HOME/rsvim/rsvim.{js,ts}
tip

For environment variable $XDG_CONFIG_HOME, it has different default value on different platforms:

  • On Linux, it is $HOME/.config/rsvim.
  • On MacOS, it is $HOME/Library/Application Support/rsvim.
  • On Windows, it is %USERPROFILE%\AppData\Roaming\rsvim (or %APPDATA%\rsvim).

~/.rsvim/

Then it tries to find whether below directory and entry file exist:

  • Config home: ~/.rsvim/
  • Config entry: ~/.rsvim/rsvim.{js,ts}

~/.rsvim.{js,ts}

Finally it tries to find whether below entry file exists:

  • Config entry: ~/.rsvim.{js,ts}

For the last location, it doesn't have a config home at all. This will disable package resolving for Rsvim, while file-based modules are still available though.

Please refer to Simple Package for more details about packages, and Multiple Files for file modules.