# @convertkit/slate-keymap

> A Slate plugin to simplify keyboard shortcuts

Latest version **0.1.10** (published 2020-04-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install @convertkit/slate-keymap
pnpm add @convertkit/slate-keymap
yarn add @convertkit/slate-keymap
bun add @convertkit/slate-keymap
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.10 |
| Published | 2020-04-10 |
| First published | 2019-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 17.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | bcarney, christinacole, ivanmp-convertkit, jurezove, krishamoud, marksouthard, mbbbb, noelherrick, raquelxmoss |

## Links

- npm: https://www.npmjs.com/package/@convertkit/slate-keymap
- npm.io page: https://npm.io/package/@convertkit/slate-keymap

## Dependencies (1)

- [is-hotkey](https://npm.io/package/is-hotkey.md) ^0.1.4

## Recent versions

- 0.1.10 (latest) — 2020-04-10
- 0.1.9 — 2019-10-24
- 0.1.8 — 2019-03-20
- 0.1.7 — 2019-03-03
- 0.1.6 — 2019-03-01
- 0.1.5 — 2019-02-25
- 0.1.4 — 2019-02-20
- 0.1.3 — 2019-02-18
- 0.1.2 — 2019-02-18
- 0.1.1 — 2019-02-15
- 0.1.0 — 2019-02-15
- 0.0.3 — 2019-01-29
- 0.0.2 — 2019-01-22
- 0.0.1 — 2019-01-22

## README

# Slate Keymap

![](https://img.shields.io/circleci/project/github/ConvertKit/slate-plugins/master.svg?style=flat)

[View on Github](https://github.com/ConvertKit/slate-plugins)

A plugin for simplifying keyboard shortcuts with SlateJS. `slate-keymap` uses
`is-hotkey` under the hood to check if an event matches the configured keys.

## Install

```sh
yarn add @convertkit/slate-keymap
```

## Usage

`Keymap(object: Object, options: Object)`

### Example

```javascript
import Keymap from "@convertkit/slate-keymap";

const plugins = [
  Keymap({
    "mod+a": (event, editor) => editor.selectAll(),
    // You can also pass a string and it will call the command with that name
    "shift+enter": "softBreak"
  })
];
```

### Options

- `if`: A function that is passed the `editor` instance. If it returns true,
  then the Keymap is active. Defaults to `() => true`

---
_Source: https://npm.io/package/@convertkit/slate-keymap · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
