# Vim search \(\#2657\) · gitcafe/zed

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

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

Visibility: public

Requested revision: 843e74689dc9eb664a150c93e8c48930f91073a0

Requested commit: 843e74689dc9eb664a150c93e8c48930f91073a0

Commit: 843e74689dc9eb664a150c93e8c48930f91073a0

Tree: 4040c2dc9ebe3129078e001474f4a6be1d8ce483

Author: Conrad Irwin

Committer: GitHub

## Message

```
Vim search (#2657)

This PR makes searching in vim mode significantly more like vim.

I re-used search to implement "go to next instance of word under cursor"
as this is how it works in vim (for integration with other
search-related keyboard shortcuts) and to avoid having to rewrite all
the logic to be vim-specific; but that did mean I had to make some
changes to the way search works (in particular to allow different
searches to run with specific options).

Release Notes:
- vim: `<enter>` in search now puts you back in normal mode
([#1583](https://github.com/zed-industries/community/issues/1583))
- vim: `?` now works to search backwards.
- vim: jumping to definitions or search results keeps you in normal mode
([#1284](https://github.com/zed-industries/community/issues/1284))
([#1514](https://github.com/zed-industries/community/issues/1514))
- vim: `n`/`N` are now supported to jump to next/previous match after a
search
([#1583](https://github.com/zed-industries/community/issues/1583))
- vim: `*`/`#`/`g*`/`g#` are now supported to jump to the next/previous
occurrence of the word under the cursor.
- vim: `gD` now jumps to type definition
```

## Parents

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

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

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