How can I switch from forward to backward search in Vim?
Problem
In Vim, I know that will search forward from the cursor, with and repeating the search forward and backward, respectively. I also know that will search backward from the cursor, with and repeating the search backward and forward, respectively. My question is, if I've done a search, and I want to re-run that as a search (so I don't have to keep holding shift to move forward), is there a way to switch the previous search's direction without retyping the search term?
Error Output
/
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Fix for: How can I switch from forward to backward search in Vim?
Simply typing a without any text following it will re-run the search backwards. I.e. typing Return or Return will always rerun the last search, but in the direction you want.
Awaiting Verification
Be the first to verify this fix
Sign in to verify this fix