# vim: Add \`use_match_quotes\` setting for % motion, default is \`true\` \(\#42615\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/1062e2c5a9e9764b58c5c3fdec6a5b9bddd1dd2e)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 1062e2c5a9e9764b58c5c3fdec6a5b9bddd1dd2e

Requested commit: 1062e2c5a9e9764b58c5c3fdec6a5b9bddd1dd2e

Commit: 1062e2c5a9e9764b58c5c3fdec6a5b9bddd1dd2e

Tree: 9b2231b30f0f4d6d61dc8ab3f48247cffe226af4

Author: Hans

Committer: GitHub

## Message

````
vim: Add `use_match_quotes` setting for % motion, default is `true` (#42615)

Add a `match_quotes` parameter to the `vim::Matching` action that
controls whether the `%` motion should treat quote characters (', ", `)
as matching pairs.

In Neovim, `%` only matches bracket pairs (([{}])), not quotes. Zed's
existing behavior includes quote matching, which some users prefer. To
preserve backwards compatibility while allowing users to opt into
Neovim's behavior, this PR:

1. Adds an optional `match_quotes` boolean parameter to the
   `vim::Matching` action
2. Updates the default vim keymap to use ["vim::Matching", {
   "match_quotes": true }], preserving Zed's current behavior
3. Users who prefer Neovim's behavior can rebind `%` in their keymap:

```
{
    "context": "VimControl && !menu",
    "bindings": {
        "%": ["vim::Matching", { "match_quotes": false }]
    }
}
```

When `match_quotes` is `false`, the `%` motion will skip over quote
characters and only match brackets/parentheses, matching Neovim's
default behavior.

Release Notes:

- vim: Added match_quotes parameter to the vim::Matching action to control
whether % matches quote characters

---------

Co-authored-by: dino <dinojoaocosta@gmail.com>
````

## Parents

- [a94157714a58ecad9b242c1ffe1c32473fff07ad](https://git.cafe/gitcafe/zed/commit/a94157714a58ecad9b242c1ffe1c32473fff07ad?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/1062e2c5a9e9764b58c5c3fdec6a5b9bddd1dd2e?format=markdown)
