From d537b0d7ea5861f607f234d60fb24b54640abb15 Mon Sep 17 00:00:00 2001 From: jbranchaud Date: Wed, 20 Feb 2019 16:34:21 -0600 Subject: [PATCH] Add Search Backward Through A File as a vim til --- README.md | 3 ++- vim/search-backward-through-a-file.md | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 vim/search-backward-through-a-file.md diff --git a/README.md b/README.md index 5a19808..34f613d 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ smart people at [Hashrocket](http://hashrocket.com/). For a steady stream of TILs from a variety of rocketeers, checkout [til.hashrocket.com](https://til.hashrocket.com/). -_770 TILs and counting..._ +_771 TILs and counting..._ --- @@ -847,6 +847,7 @@ _770 TILs and counting..._ - [Rotate Everything By 13 Letters](vim/rotate-everything-by-13-letters.md) - [Running Bundle With vim-bundler](vim/running-bundle-with-vim-bundler.md) - [Scrolling Relative to the Cursor](vim/scrolling-relative-to-the-cursor.md) +- [Search Backward Through A File](vim/search-backward-through-a-file.md) - [Searching For Hex Digits](vim/searching-for-hex-digits.md) - [Set End Of Line Markers](vim/set-end-of-line-markers.md) - [Set Your Color Scheme](vim/set-your-color-scheme.md) diff --git a/vim/search-backward-through-a-file.md b/vim/search-backward-through-a-file.md new file mode 100644 index 0000000..5ec4f7c --- /dev/null +++ b/vim/search-backward-through-a-file.md @@ -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.