Skip to content

Commit

Permalink
README: describe how to invoke multiple widgets with a keybinding
Browse files Browse the repository at this point in the history
  • Loading branch information
akinomyoga committed Dec 11, 2021
1 parent b6fc4f0 commit 6123551
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
16 changes: 16 additions & 0 deletions README-ja_JP.md
Expand Up @@ -483,6 +483,22 @@ $ ble-bind -P
$ ble-bind -L
```

一つのキーで複数の編集関数を呼び出したい場合は、以下の例の様に、
`ble/widget/編集関数の名前` という名前のシェル関数を通して新しい編集関数を定義できます。
既存の標準の編集関数と名前が重複しない様に、
編集関数の名前は `ユーザー名/`, `my/`, `blerc/`, `dotfiles/` などで始める事が強く推奨されます。

```bash
# C-t で複数の操作を行う例
function ble/widget/my/example1 {
ble/widget/beginning-of-logical-line
ble/widget/insert-string 'echo $('
ble/widget/end-of-logical-line
ble/widget/insert-string ')'
}
ble-bind -f C-t my/example1
```

# 3 ヒント

## 3.1 複数行モード
Expand Down
16 changes: 16 additions & 0 deletions README.md
Expand Up @@ -453,6 +453,22 @@ The list of widgets is shown by the following command:
$ ble-bind -L
```

If you want to run multiple widgets with a key, you can define your own widget by creating a function of the name `ble/widget/YOUR_WIDGET_NAME`
as illustrated in the following example.
It is highly recommended to prefix the widget name with `YOUR_NAME/`, `my/`, `blerc/`, `dotfiles/`, etc.
in order not to conflict with the names of the existing standard widgets.

```bash
# Example of calling multiple widgets with the key C-t
function ble/widget/my/example1 {
ble/widget/beginning-of-logical-line
ble/widget/insert-string 'echo $('
ble/widget/end-of-logical-line
ble/widget/insert-string ')'
}
ble-bind -f C-t my/example1
```

# 3 Tips

## 3.1 Use multiline mode
Expand Down
1 change: 1 addition & 0 deletions docs/ChangeLog.md
Expand Up @@ -200,6 +200,7 @@

- blerc: add all the missing options `#D1667` 0228d76
- blerc: add missing faces `argument_option` and `cmdinfo_cd_cdpath` (reported by Prikalel) `#D1675` 26aaf87
- README: describe how to invoke multiple widgets with a keybinding (motivated by michaelmob) `#D1699` 0000000

## Optimization

Expand Down
8 changes: 5 additions & 3 deletions note.txt
Expand Up @@ -1621,9 +1621,6 @@ bash_tips
* PROMPT_COMMAND / trap DEBUG で問題が起こる? (found by rashad-moves)
https://github.com/rashad-moves/HomeConfigurationFiles/commit/efbac4153fd5021f1bc00d42c618fd9d6f4090b9

* 一つのキーで複数の widget を呼び出す方法?
https://github.com/michaelmob/portable-config/commit/49f9566afd8b62d47a090328104ad803962e6d3f

2021-12-06

* complete: 沢山 quote が発生する場合には '' で囲むべきなのではないか。
Expand Down Expand Up @@ -5633,6 +5630,11 @@ bash_tips

2021-12-11

* README: 一つのキーで複数の widget を呼び出す方法? (motivated by michaelmob) [#D1699]
https://github.com/michaelmob/portable-config/commit/49f9566afd8b62d47a090328104ad803962e6d3f

説明を書いた。設定例の動作確認もした。

* bind: "" で囲まれていない keyseq \C-l を解釈できない (motivated by cmplstofB) [#D1698]
https://github.com/cmplstofB/dotfiles/blob/master/_dffiles/.config/bash/bashrc#L170-L172

Expand Down

0 comments on commit 6123551

Please sign in to comment.