I'm running iTerm2. When do a text search ⌘ F, pressing Return moves the highlighted occurrence back (the previous occurrence). Is there a way to make it move to the next (forward) occurrence?
3 Answers
Searching in reverse is apparently how iTerm's search works by design (see https://gitlab.com/gnachman/iterm2/issues/4491).
As a user, I also find this design decision confusing.
If you would like to make Find Next
/ Find Previous
in iTerm behave consistently with other apps, here are the proper keybinding overrides to add in System Preferences > Keyboard
.
Note that I had to restart iTerm for the keybindings to fully take effect.
Like @Taylor D. Edmiston said, this is iTerm's default behavior. However, there's now an iTerm2 setting in Preferences > Advanced > General
to revert that behavior to "normal" when set to "No" (next is down, previous is up):
https://gitlab.com/gnachman/iterm2/-/issues/2049
Commit a99ed9b1 adds an advanced preference named "Swap Find Next and Find Previous". It defaults to "Yes". When disabled, search acts like a standard application. The only thing the setting does not affect is key bindings, which presumably work the way you want, and are also labeled "find up" and "find down" which is unambiguous.
The numeration is still "backward" (e.g. 1/20 will be the lowest down text match) but otherwise works the same as you would expect of other applications.

- 21
Try using Shift+Enter to reach the next occurrence.

- 1,239
-
1We're looking for long answers that provide some explanation and context. Don't just give a one-line answer: please explain why you're recommending it as a solution. Answers that don't explain anything may be deleted. – Allan May 02 '16 at 17:39
-
I apologize, I'm new here. I tried to find documentation on the internet to back up my personal experience, and I found this thread. In the future, should I find a source on the web with my answers? https://groups.google.com/forum/#!searchin/iterm2-discuss/find/iterm2-discuss/XL55TiIlPOw/-rNB1dp1VA0J – TMHahn May 02 '16 at 17:43
-
That's ok...it's how we learn.....but I don't belive shift-enter does anything in this context. You might want to try Cmd-G or just Enter – Allan May 02 '16 at 17:54
-
Function Keys
is related to the MacBook Pro touch bar. Any chance you are working on a non-touch bar machine? – Taylor D. Edmiston Mar 09 '20 at 19:34