/plur

Easily (I hope) search and replace multiple variants of a word

Primary LanguageEmacs Lisp

Plur

https://travis-ci.org/xuchunyang/plur.svg?branch=master https://melpa.org/packages/plur-badge.svg

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

Replace example

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}

Search example

To search “mouse” and “mice” using:

M-x plur-isearch-forward RET m{ouse,ice}

Requirements

  • Emacs 24.4 or higher

Installation

MELPA

Plur is available from Melpa. You can install it using:

M-x package-install RET plur RET

Manually

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.

Acknowledge

This package is inspired by vim-abolish.