mirror of
https://github.com/zed-industries/zed.git
synced 2025-02-12 05:27:07 +00:00
9e31b1019e
Some checks are pending
CI / Check Postgres and Protobuf migrations, mergability (push) Waiting to run
CI / Check formatting and spelling (push) Waiting to run
CI / (macOS) Run Clippy and tests (push) Waiting to run
CI / (Linux) Run Clippy and tests (push) Waiting to run
CI / (Linux) Build Remote Server (push) Waiting to run
CI / (Windows) Run Clippy and tests (push) Waiting to run
CI / Create a macOS bundle (push) Blocked by required conditions
CI / Linux x86_x64 release bundle (push) Blocked by required conditions
CI / Linux arm64 release bundle (push) Blocked by required conditions
CI / Auto release preview (push) Blocked by required conditions
Deploy Docs / Deploy Docs (push) Waiting to run
Docs / Check formatting (push) Waiting to run
Script / ShellCheck Scripts (push) Waiting to run
# Add AnyBrackets text object for Vim mode ## Overview This PR introduces a new text object `AnyBrackets` that allows operations on the closest matching pair of brackets, regardless of the bracket type. This enhances the editing experience by reducing the need to identify specific bracket types before performing text operations. By default, this feature is NOT mapped to any key in vim.json. However, it can be enabled manually, and the recommended key for mapping is b: If you want to add it to your zed keymap config you need to add the following config: ```json { "context": "vim_operator == a || vim_operator == i || vim_operator == cs", "bindings": { "b": "vim::AnyBrackets" } } ``` ## Features - New text object that works with parentheses `()`, square brackets `[]`, curly braces `{}`, they are also know as round brackets, square brackets and curly brackets in english. - Automatically finds the closest matching pair of any bracket type - Works with all standard Vim operators (delete, change, yank) - Supports both "inside" and "around" variants (`i` and `a`) ## Usage Examples ```vim # Delete inside the closest brackets di( # Works on (), [] or {} depending on which is closest # Change around the closest brackets ca[ # Works on (), [] or {} depending on which is closest # Visual select inside the closest brackets vi{ # Works on (), [] or {} depending on which is closest ``` # References: - Based on the popular plugin https://github.com/echasnovski/mini.ai # Important Notes This PR also fixes a bug with nested quotes on AnyQuotes, now it works fine with any type of quotes or brackets. Please take a look at the new tests to understand the expected behavior. Release Notes: - vim: Add `ab`/`ib` "AnyBrackets" text objects that are the smallest of `a(`, `a[` or `a{` or `i(`, `i[` or `i{` - vim: Fix aq/iq "AnyQuotes" text objects when they are nested |
||
---|---|---|
.. | ||
fonts | ||
icons | ||
images | ||
keymaps | ||
prompts | ||
settings | ||
sounds | ||
themes |