diff --git a/docs/src/vim.md b/docs/src/vim.md index e60e084ac13cf935be49ab3b87304317df971d77..e53e37fb31235c7a0d5e1bc0ec8eb8c4469f0acd 100644 --- a/docs/src/vim.md +++ b/docs/src/vim.md @@ -354,14 +354,35 @@ These commands modify editor options locally for the current buffer. ### Command mnemonics -As any Zed command is available, you may find that it's helpful to remember mnemonics that run the correct command. For example: - -- `:diffs` for "toggle all hunk diffs" -- `:cpp` for "copy path to file" -- `:crp` for "copy relative path" -- `:reveal` for "reveal in finder" -- `:zlog` for "open zed log" -- `:clank` for "cancel language server work" +Zed does not ship with any command mnemonics by default, but you can define short aliases for Zed commands using the `command_aliases` setting in your settings file. When you type an alias from this map in the command palette, it resolves to the mapped command. + +#### Example Configuration + +To configure command mnemonics, add the `command_aliases` key to your settings file. Here's an example configuration with useful mnemonics: + +```json [settings] +{ + "command_aliases": { + "zlog": "zed::OpenLog", + "newf": "workspace::NewFile", + "diffs": "editor::ToggleSelectedDiffHunks", + "crp": "workspace::CopyRelativePath", + "cpp": "workspace::CopyPath", + "reveal": "editor::RevealInFileManager", + "clank": "editor::CancelLanguageServerWork" + } +} +``` + +With this configuration, you can use commands like: + +- `:zlog` - Open the Zed log +- `:newf` - Create a new file +- `:diffs` - Toggle selected diff hunks +- `:crp` - Copy the relative path to the current file +- `:cpp` - Copy the full path to the current file +- `:reveal` - Reveal the current file in the file manager +- `:clank` - Cancel language server work ## Customizing key bindings