A dynamic command snippet manager for the Fish shell. Save complex commands with metadata, use templates with variables, and perform interactive searches using fzf.
The following tools must be installed:
Using fisher:
fisher install code-hive-colombia/cmdvault.fish
The plugin configures the following default bindings (using the Alt key to ensure compatibility across terminal emulators):
| Key | Action | Description |
|---|---|---|
| Alt + S | add-cmd |
Saves the current command line buffer. |
| Alt + A | get-cmd |
Opens fzf to search and insert a saved command. |
| Alt + X | get-cmd-run |
Opens fzf to search and execute a saved command. |
| Alt + R | remove-cmd |
Opens fzf to select and delete a saved command. |
| Alt + E | edit-cmd-file |
Opens the JSON storage file in your $EDITOR. |
You can also manage your vault directly via commands:
add-cmd [-n NAME] [-d DESCRIPTION]: Adds a command. If flags are missing, it will prompt for input. SupportsCtrl+Cto cancel.get-cmd: Triggers the interactive search and placeholder replacement.remove-cmd [-n NAME]: Removes a command by name or opens a selector if no name is provided.edit-cmd-file: Manual access to the serialized data.
You can save commands containing placeholders using the %variable% syntax. When you retrieve the command, the extension will prompt you for a value for each placeholder.
Example:
- Save a command as:
git commit -m "%message%" - When selected via Alt + A, the shell will prompt:
Value for 'message': - Result:
git commit -m "your custom message"
The commands are stored in a JSON file located at:
~/.config/fish/commands_store.json