This package introduces a new syntax ...{subexp1,subexp2,...}...
to search and replace a
group of words. Three commands are provided by this package:
plur-isearch-forward
plur-query-replace
plur-replace
To replace “mouse” with “cat” and “mice” with “cats” using:
M-x plur-query-replace RET m{ouse,ice} RET cat{,s} RET
For more examples,
- Facility to Building
facilit{y,ies} building{,s}
- Mouse to Trackpad
m{ouse,ice} trackpad{,s}
- Swap Emacs and Vim
{emacs,vim} {vim,emacs}
To search “mouse” and “mice” using:
M-x plur-isearch-forward RET m{ouse,ice}
- Emacs 24.4 or higher
Plur is available from Melpa. You can install it using:
M-x package-install RET plur RET
Make sure plur.el is saved in a directory in you load-path
and load it. Add something
like
(add-to-list 'load-path "path/to/plur/")
(require 'plur)
to your init file.
This package is inspired by vim-abolish.