Skip to content

Commit

Permalink
docs: allow disabling certain preset keybinds with the new noop vir…
Browse files Browse the repository at this point in the history
…tual command
  • Loading branch information
sxyazi committed Nov 3, 2024
1 parent 499a02e commit e493289
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions docs/configuration/keymap.md
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,28 @@ Open the help menu.

See [Functional plugin](/docs/plugins/overview#functional-plugin).

### `noop` {#manager.noop}

If you want to disable certain preset keybindings without rewriting the entire `keymap`, you can use the virtual `noop` command.

For example, to disable the default keybinding of <kbd>g</kbd> ⇒ <kbd>c</kbd>, use:

```toml
[[manager.prepend_keymap]]
on = [ "g", "c" ]
run = "noop"
```

Or, if you prefer an array style:

```toml
[[manager.prepend_keymap]]
on = [ "g", "c" ]
run = [ "noop" ] # The array can only have one element and must be "noop"
```

The disabled keys won't trigger any actions when pressed and won't show up in the `which` component.

## [tasks] {#tasks}

### `close` {#tasks.close}
Expand Down Expand Up @@ -514,6 +536,10 @@ Open the help menu.

See [Functional plugin](/docs/plugins/overview#functional-plugin).

### `noop` {#tasks.noop}

See [`noop` command](#manager.noop).

## [select] {#select}

### `close` {#select.close}
Expand All @@ -538,6 +564,10 @@ Open the help menu.

See [Functional plugin](/docs/plugins/overview#functional-plugin).

### `noop` {#select.noop}

See [`noop` command](#manager.noop).

## [input] {#input}

### `close` {#input.close}
Expand Down Expand Up @@ -641,6 +671,10 @@ Kill the specified range of characters. This command is only available in insert

See [Functional plugin](/docs/plugins/overview#functional-plugin). This command is only available in insert mode.

### `noop` {#input.noop}

See [`noop` command](#manager.noop).

## [completion] {#completion}

### `close` {#completion.close}
Expand Down Expand Up @@ -669,6 +703,10 @@ Open the help menu.

See [Functional plugin](/docs/plugins/overview#functional-plugin).

### `noop` {#completion.noop}

See [`noop` command](#manager.noop).

## [help] {#help}

### `close` {#help.close}
Expand All @@ -692,3 +730,7 @@ Apply a filter for the help items.
### `plugin` {#help.plugin}

See [Functional plugin](/docs/plugins/overview#functional-plugin).

### `noop` {#help.noop}

See [`noop` command](#manager.noop).

0 comments on commit e493289

Please sign in to comment.