# prosemirror-find-replace

> Find and Replace plugin for ProseMirror

Latest version **0.9.0** (published 2016-06-03) · MIT license · 0 weekly downloads

## Install

```sh
npm install prosemirror-find-replace
pnpm add prosemirror-find-replace
yarn add prosemirror-find-replace
bun add prosemirror-find-replace
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.9.0 |
| Published | 2016-06-03 |
| First published | 2016-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 18 |
| Author | Matthew Berkowitz |
| Maintainers | mattberkowitz |

## Links

- npm: https://www.npmjs.com/package/prosemirror-find-replace
- Repository: https://github.com/mattberkowitz/prosemirror-find-replace
- Homepage: https://github.com/mattberkowitz/prosemirror-find-replace#readme
- Issues: https://github.com/mattberkowitz/prosemirror-find-replace/issues
- npm.io page: https://npm.io/package/prosemirror-find-replace

## Recent versions

- 0.9.0 (latest) — 2016-06-03
- 0.8.0 — 2016-06-02
- 0.7.0 — 2016-06-01
- 0.6.0 — 2016-04-14
- 0.5.0 — 2016-02-10
- 0.4.0 — 2016-02-02
- 0.3.0 — 2016-02-01
- 0.2.0 — 2016-01-29
- 0.1.0 — 2016-01-29

## README

# prosemirror-find-replace
Find &amp; Replace plugin for ProseMirror


## Usage

Open your project in command prompt and run:

`npm install prosemirror --save`

`npm install prosemirror-find-replace --save`


In your ProseMirror initialization script:

```
import { ProseMirror } from "prosemirror"
import "prosemirror-find-replace"

let pm = new ProseMirror({
  place: document.querySelector("#target"),
  find: {}
})
```


### Options

The following options can be passed in the find object when ProseMirror is initialized:

**atuoSelectNext** *(Boolean, default: true)*: Moves user selection to the next find match after and find or replace

**findClass** *(String, default:"find")*: Class to apply to find matches


### Commands

A simple, default set of commands is included, if you choose to use them:

```
import { ProseMirror, CommandSet } from "prosemirror/dist/edit"
import { findCommands } from "prosemirror-find-replace"

let pm = new ProseMirror({
  place: document.querySelector("#target"),
  find: {},
  commands: CommandSet.default.add(findCommands)
})
```

**find** *(Meta + F)* - Highlights all matches of find term, selects next one if `autoSelectNext` option is true

**findNext** *(Alt + Meta + F)* - Moves selection to next match of previous find

**replace** *(Shift + Meta + F)* - Finds next match and replaces it

**replaceAll** *(Shift + Alt + Meta + F)* - Finds and replaces all matches

**clearFind** *(No shortcut)* - Clears highlighted find results



## Demo

To run a quick demo (based on ProseMirror demo) run the following from the `prosemirror-find-replace` directory in command prompt:

`npm install`

`npm install prosemirror` (npm > 3 will not install peerDependencies for you)

`npm run demo`

Then connect to `http://localhost:8080` in your browser

---
_Source: https://npm.io/package/prosemirror-find-replace · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
