Vi Mongo Configuration Guide
Vi Mongo uses a flexible configuration system that allows you to customize various aspects of the application. This guide will walk you through the different configuration files and how to modify them.
Configuration Files
Vi Mongo uses three main configuration files:
config.yaml
: General application settings[style].yaml
: UI styling configuration instyles
directorykeybindings.json
: Keyboard shortcuts configuration
All configuration files are stored in the ~/.config/vimongo
directory (or the directory specified by the XDG_CONFIG_HOME
environment variable).
General Configuration
The config.yaml
file contains general settings for the application. Here's an overview of the main configuration options:
Key Configuration Options:
version
: The version of the configuration filelog
: Logging settings (path, level, and pretty printing)editor
: External editor settings (command and environment variable)showConnectionPage
: Show the connection page on startupshowWelcomePage
: Show the welcome page on startupcurrentConnection
: The name of the current active connectionconnections
: List of MongoDB connectionsstyles
: Styling optionsbetterSymbols
: Enable or disable improved symbolscurrentStyle
: The name of the file containing the current style settings
Connections
Each connection in the connections
list has the following properties:
url
: The MongoDB connection URL (can be empty if using individual connection details)host
: The hostname of the MongoDB serverport
: The port number for the MongoDB serverdatabase
: The name of the default database (can be empty)username
: The username for authentication (can be empty)password
: The password for authentication (can be empty)name
: A unique name for the connectiontimeout
: The connection timeout in seconds
To add a new connection, you can either use the UI or manually add an entry to the connections
list in the config.yaml
file.
Styling Configuration
The styles
directory contains available styles that allow you to customize the appearance of Vi Mongo. Each style file is named after the style it represents (e.g., default.yaml
, dark-blue.yaml
, etc.).
Here's an example of the structure for a style file:
You can customize colors using hex color codes. Make sure to keep the YAML structure intact when modifying the file.
Keybindings Configuration
The keybindings.json
file allows you to customize keyboard shortcuts for various actions in Vi Mongo. The file is structured by different sections of the application. Here's an example:
Customizing Keybindings:
keys
: An array of key combinations (e.g., "Ctrl+H", "Enter")runes
: An array of single characters (e.g., "?", "a")description
: A brief description of the action
Known Keybinding Issues
When configuring keybindings, be aware of some potential issues:
- Ctrl+H: This key combination is often interpreted as the Backspace2 (Ctrl+backspace) key in terminal environments, For this given case there is special handling in place to make it work as expected. For others like Ctrl+I there is no special handling in place, so those keybindings won't work as expected.
- Terminal Limitations: Some key combinations might not work as expected due to limitations in certain terminal emulators. If a keybinding doesn't seem to work, try an alternative combination.
If you encounter unexpected behavior with your custom keybindings, consider these potential issues and try alternative key combinations.
Applying Changes
After modifying any configuration file, you need to restart Vi Mongo for the changes to take effect. The application will automatically load the updated configuration on startup.
Resetting to Defaults
If you want to reset your configuration to the default settings, you can delete the configuration files from the ~/.config/vimongo
directory. The next time you start Vi Mongo, it will recreate the configuration files with default values.
Troubleshooting
If you encounter any issues after modifying the configuration files, try the following steps:
- Verify that the YAML/JSON syntax is correct in the modified files.
- Check the application logs (default location:
/tmp/vi-mongo.log
) for any error messages. - Reset to default configuration by deleting the configuration files and restarting the application.
If problems persist, please open an issue on the Vi Mongo GitHub repository with details about your configuration and the encountered problem.