1
0
mirror of https://github.com/jbranchaud/til synced 2026-01-04 23:58:01 +00:00

Add Search Backward Through A File as a vim til

This commit is contained in:
jbranchaud
2019-02-20 16:34:21 -06:00
parent 0c59d05a42
commit d537b0d7ea
2 changed files with 15 additions and 1 deletions

View File

@@ -0,0 +1,13 @@
# Search Backward Through A File
There are a number of ways to search for a match in a file. One I use quite
often is hitting `*` while the cursor is over the word I want to find
matches for. It searches forward jumping to the next occurrence of that
word.
It turns out there is a way of doing the same thing, but searching backward
to the previous occurrence of the word. If you hit `#` with the cursor over
a word, it will jump backward through the file until it finds an occurrence
of that word. Keep hitting `#` to keep searching backward.
See `:h #` for more details.