Introduction
I used to use default hotkeys in all editors. This made me to remember how to
open Recent projects or Terminal in VS Code, RustRover, Atom and other editors.
About 6 months ago I tried Vim and then Neovim. Firstly I just copy-pasted random snippets to my nvim config and used it as is. Then I had fully rewriten my config and added some useful shortcuts (you can find my config in my dotfiles repo). Now my main editor is Zed. I have written some keybindings for it.
Project Panel
I tried to create keybindings similar to nvim-tree ones.
aIt looks like this:
[
{
"context": "ProjectPanel && !editing",
"bindings": {
"a": "project_panel::NewFile",
"A": "project_panel::NewDirectory",
"d": "project_panel::Trash",
"D": "project_panel::Delete",
"r": "project_panel::Rename",
"x": "project_panel::Cut",
"c": "project_panel::Copy",
"p": "project_panel::Paste",
"q": "workspace::ToggleLeftDock"
}
}
] Outline
I use Outline in Zed frequently, it’s only panel which opened 80% of my time inside editor.
alt-o[
{
"context": "Workspace",
"bindings": {
"alt-o": "outline_panel::ToggleFocus"
}
}
] Git
While I mainly use Git from terminal, sometimes I need fast and easy access to Git right from IDE. I found this hotkey for lazygit in Hidden Gems: Team Edition Part 1 article and it’s really useful!
alt-g[
{
"context": "Workspace",
"bindings": {
"alt-g": "git_panel::ToggleFocus",
"ctrl-alt-g": ["task::Spawn", { "task_name": "LazyGit", "reveal_target": "center" }]
}
}
] Empty screen
When I just start new Zed window or close project I want to perform some quick actions, these hotkeys help me in this!
spacespace[
{
"context": "EmptyPane || SharedScreen",
"bindings": {
"space space": "file_finder::Toggle",
"space p": "projects::OpenRecent",
"space e": "zed::Extensions"
}
}
] Editor
I very like duplicating lines with ctrl-d, it’s useful. Sometimes I also need
to copy file name or position in it.
ctrl-d[
{
"context": "Editor",
"bindings": {
"ctrl-d": "editor::DuplicateLineDown",
"ctrl-shift-c": "editor::CopyFileName",
"ctrl-shift-l": "editor::CopyFileLocation"
}
}
] Vim mode
I frequently (but not always) use Vim mode so I have dedicated keybinding to fastly toggle Vim mode.
ctrl-alt-shift-v[
{
"context": "Workspace",
"bindings": {
"ctrl-alt-shift-v": "workspace::ToggleVimMode"
}
},
{
"context": "Editor && (vim_mode == normal || vim_mode == visual) && !VimWaiting && !menu",
"bindings": {
"space g h d": "editor::ToggleSelectedDiffHunks",
"space t i": "editor::ToggleInlayHints",
"space u w": "editor::ToggleSoftWrap",
"space m p": "markdown::OpenPreview",
"space m P": "markdown::OpenPreviewToTheSide",
"space s w": "pane::DeploySearch",
"space f": "editor::Format"
}
}
] I hope you enjoyed the article. Found mistake, typo or have feedback? Feel free to open issue/PR in website repo.