This post started as a quick note (mainly to myself) about a handy sub-feature within emacs find. Since reading through the documentation, I need to mention a few other sub-features too.
As I’ve probably mentioned before, I use both vim and emacs. One great feature of vim is that if you press
* it searches for the word that your cursor is over.
* choose a backwards or forwards search respectively.
There is a similar convenience when using emacs search in that if you enter search using
C-w chooses the word you are looking at. I always forget about this feature and my google-fu is never good enough to find it again. Fortunately I recently came across it again when I was looking at the documentation for
C-s (isearch-forward) using
C-h k C-s.
It turns out that isearch is implemented by a minor mode (logically enough when you think about it) that adds a whole bunch of useful keys, including
C-w we mentioned earlier. Other notable features are:
C-M-wdelete last character in search string
M-rtoggle regular-expression mode
M-eedit search string
And to replace search strings there are: