Files
zed/crates/vim
Parker Loflin eadffde6e9 Remove dead code, orphaned files, and unused config entries (#67664)
## Summary

Removes code, files and config entries that nothing in the repository
uses. Follow-up to the cleanups in #67126 through #67219. No behavior
changes.

- `project`: removes `SshLspAdapter`, which nothing has constructed
since language server adapters moved to the remote server. Also removes
`RepositorySnapshot::diff_stat_for_path` and its `Repository` wrapper,
`BufferStore::loading_buffers` and
`LocalLspStore::running_language_server_for_id`.
- `git_ui`: removes `move_to_project_path` from `ProjectDiff` and
`DiffMultibuffer`. #67149 removed their last caller.
- `editor`: removes `DisplaySnapshot::reverse_text_chunks` and
`DisplaySnapshot::excerpt_header_height`, and `BlockSnapshot`'s copy of
the excerpt header height, which only the latter read.
- `copilot`: removes the `setEditorInfo`, `notifyAccepted` and
`notifyRejected` request types, which Zed no longer sends.
- Removes unused helpers in `acp_thread`, `agent`, `client`, `collab`,
`fs`, `git`, `markdown`, `settings_ui`, `text`, `ui`, `util` and
`workspace`. `util` drops its `serde_json_lenient` dependency.
- `edit_prediction_cli` drops its library target, which only held a
private module. `cli` drops an uncalled `wait_for_socket` on Linux.
- Deletes orphaned files:
- 12 vim Neovim recordings for tests that were removed or don't use
`NeovimBackedTestContext`
- `script/seed-db`, which runs a removed `collab` subcommand, and
`crates/collab/seed/github_users.json`, which only seeding read
- `script/squawk` and its config, `script/upload-nightly.ps1` and its
helper, and the dev drive scripts, which no workflow or script calls
- `Dockerfile-cross.dockerignore`, `crates/db/README.md` and
`assets/themes/.gitkeep`
- Removes config entries for things that no longer exist: typos excludes
and an ignore pattern, a clippy entry for the removed `cocoa` crate,
license clarifications for crates no longer in `Cargo.lock`, `ci.yml`
references in actionlint and `check-todos`, AGENTS.md links to deleted
crash tooling, a dependency line in the `new-crate` template for a crate
that no longer exists, and the unread `repl.output_max_width_columns`
default with its docs.

### Suggested AGENTS.md additions

> For `crates/vim`: `NeovimBackedTestContext` reads `test_data/<test
name>.json`. When you remove or rename a Neovim-backed test, delete or
rename its recording too; nothing flags orphaned recordings.

## Testing

- No references to the removed items, files or settings key remain in
the tree, including in other platforms' cfg-gated code, docs and
scripts.
- `./script/clippy`
- `cargo check --workspace --all-targets` with `-D warnings`, with
default features and with `--all-features`
- `cargo fmt --all -- --check`
- `cargo test -p xtask -- workspace::`
- `cargo test -p vim -p util -p git -p text -p markdown -p fs`

## Self-review

- [x] I've reviewed my diff for quality, security, reliability, and
performance.
- [x] UI changes follow the
[checklist](https://zed.dev/docs/development/ui-checklist).
- [x] Tests cover the new or changed behavior.

Release Notes:

- N/A
2026-11-30 21:06:49 +00:00
..
…

This contains the code for Zed's Vim emulation mode.

Vim mode in Zed is supposed to primarily "do what you expect": it mostly tries to copy vim exactly, but will use Zed-specific functionality when available to make things smoother. This means Zed will never be 100% vim compatible, but should be 100% vim familiar!

The backlog is maintained in the #vim channel notes.

Testing against Neovim

If you are making a change to make Zed's behavior more closely match vim/nvim, you can create a test using the NeovimBackedTestContext.

For example, the following test checks that Zed and Neovim have the same behavior when running * in visual mode:

#[gpui::test]
async fn test_visual_star_hash(cx: &mut gpui::TestAppContext) {
    let mut cx = NeovimBackedTestContext::new(cx).await;

    cx.set_shared_state("ˇa.c. abcd a.c. abcd").await;
    cx.simulate_shared_keystrokes(["v", "3", "l", "*"]).await;
    cx.assert_shared_state("a.c. abcd ˇa.c. abcd").await;
}

To keep CI runs fast, by default the neovim tests use a cached JSON file that records what neovim did (see crates/vim/test_data), but while developing this test you'll need to run it with the neovim flag enabled:

cargo test -p vim --features neovim test_visual_star_hash

This will run your keystrokes against a headless neovim and cache the results in the test_data directory. Note that neovim must be installed and reachable on your $PATH in order to run the feature.

Testing zed-only behavior

Zed does more than vim/neovim in their default modes. The VimTestContext can be used instead. This lets you test integration with the language server and other parts of zed's UI that don't have a NeoVim equivalent.