vim: Command (#2951)
Release Notes: - vim: Add v1 of command mode ([#279](https://github.com/zed-industries/community/issues/279)). The goal was to cover 90% of what most people actually do, but it is very incomplete. Known omissions are that ranges cannot be specified (except that `:%s//` must always specify the % range), commands cannot take arguments (you can `:w` but not `:w [file]`), and there is no history. Please file feature requests on https://github.com/zed-industries/community as you notice things that could be better. - `:` triggers zed's command palette. If you type a known vim command it will run it, otherwise you get zed's normal fuzzy search. For this release supported commands are limited to: - - `:w[rite][!]`, `:wq[!]`, `:q[uit][!]`, `:wa[ll][!]`, `:wqa[ll][!]`, `:qa[ll][!]`, `:[e]x[it][!]`, `:up[date]` to save/close tab(s) and pane(s). - - `:cq` to quit completely. - - `:vs[plit]`, `:sp[lit]` to split vertically/horizontally - - `:new`, `:vne[w]` to create a new file in a new pane above or to the left - - `:tabedit`, `:tabnew` to create a new file in a new tab. - - `:tabn[ext]`, `:tabp[rev]` to go to previous/next tabs - - `:tabc[lose]` to close tabs - - `:cn[ext]`, `:cp[rev]`, `:ln[ext]`, `:lp[rev]` to go to the next/prev diagnostics. - - `:cc`, `:ll` to open the errors page - - `:<number>` to jump to a line number. - - `:$` to jump to end of file - - `:%s/foo/bar/` (note that /g is always implied, the range must always be %, and zed uses different regex syntax to vim) - - `:/foo` and `:?foo` to jump to next/prev line matching foo - - `:j[oin]`, to join the current line (no range is yet supported) - - `:d[elete][l][p]`, to delete the current line (no range is yet supported) - - `:s[ort] [i]` to sort the current selection (case-insensitively) - vim: Add `ctrl-w o` (closes everything except the current item) and `ctrl-w n` (creates a new file in the pane above). ([#1884](https://github.com/zed-industries/community/issues/1884)) - all: Add a "Discard" option to prompt when saving a file with conflicts (previously this only appeared on close, not on save). Internal changes: - The Picker will now wait for pending queries before confirming (to handle people typing `: w enter` rapidly. - workspace::save_item and Pane::save_item are now merged together, and the behavior controlled by `workspace::SaveIntent`. - Many actions related to closing/saving items now take an optional `SaveIntent`. -
This commit is contained in:
commit
d17d38fe70
28 changed files with 1155 additions and 300 deletions
|
@ -18,6 +18,7 @@
|
|||
}
|
||||
}
|
||||
],
|
||||
":": "command_palette::Toggle",
|
||||
"h": "vim::Left",
|
||||
"left": "vim::Left",
|
||||
"backspace": "vim::Backspace",
|
||||
|
@ -205,13 +206,13 @@
|
|||
"shift-z shift-q": [
|
||||
"pane::CloseActiveItem",
|
||||
{
|
||||
"saveBehavior": "dontSave"
|
||||
"saveIntent": "skip"
|
||||
}
|
||||
],
|
||||
"shift-z shift-z": [
|
||||
"pane::CloseActiveItem",
|
||||
{
|
||||
"saveBehavior": "promptOnConflict"
|
||||
"saveIntent": "saveAll"
|
||||
}
|
||||
],
|
||||
// Count support
|
||||
|
@ -318,7 +319,17 @@
|
|||
"ctrl-w c": "pane::CloseAllItems",
|
||||
"ctrl-w ctrl-c": "pane::CloseAllItems",
|
||||
"ctrl-w q": "pane::CloseAllItems",
|
||||
"ctrl-w ctrl-q": "pane::CloseAllItems"
|
||||
"ctrl-w ctrl-q": "pane::CloseAllItems",
|
||||
"ctrl-w o": "workspace::CloseInactiveTabsAndPanes",
|
||||
"ctrl-w ctrl-o": "workspace::CloseInactiveTabsAndPanes",
|
||||
"ctrl-w n": [
|
||||
"workspace::NewFileInDirection",
|
||||
"Up"
|
||||
],
|
||||
"ctrl-w ctrl-n": [
|
||||
"workspace::NewFileInDirection",
|
||||
"Up"
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue