静的一致 |
- trigger: "hello" replace: "world"
|
複数行 |
- trigger: "hello" replace: "line1\nline2"
|
複数行 |
- trigger: "include newlines" replace: | exactly as you see will appear these three lines of poetry
|
複数行 |
- trigger: "fold newlines" replace: > this is really a single line of text despite appearances
|
動的一致 |
- trigger: ":now" replace: "It's {{mytime}}" vars: - name: mytime type: date params: format: "%H:%M"
|
グローバル変数 |
global_vars: - name: "global1" type: "shell" params: cmd: "echo global var" - name: "greet" type: "dummy" params: echo: "Hey"
|
カーソル位置 |
- trigger: ":div" replace: "$|$ "
|
タイプミス修正 |
- trigger: "ther" replace: "there" word: true
|
複数トリガー |
- triggers: ["hello", "hi"] replace: "world"
|
ケース(小文字) |
trigger: "alh" replace: "although" propagate_case: true word: true
|
ケース(先頭のみ大文字) |
trigger: "Alh" replace: "although" propagate_case: true word: tr
|
ケース(大文字) |
trigger: "ALH" replace: "although" propagate_case: true word: tr
|
画像(PNG,JPG,GIF) |
- trigger: ":cat" image_path: "$CONFIG/path/to/image.png"
|
ネストされた一致 |
- trigger: ":one" replace: "nested"
- trigger: ":nested" replace: "This is a {{output}} match" vars: - name: output type: match params: trigger: ":one"
|
スクリプト拡張 |
- trigger: ":pyscript" replace: "{{output}}" vars: - name: output type: script params:
args: - python - "%CONFIG%/path/to/your/script.py"
|
シェル拡張 |
- trigger: ":ip" replace: "{{output}}" vars: - name: output type: shell params: cmd: "curl 'https://api.ipify.org'"
|
シェルの選択 |
- trigger: ":ip" replace: "{{output}}" vars: - name: output type: shell params: cmd: "curl 'https://api.ipify.org'" shell: wsl
|
bashパイプ |
- trigger: ":localip" replace: "{{output}}" vars: - name: output type: shell params: cmd: "ip a | grep 'inet 192' | awk '{ print $2 }'"
|
出力のトリム解除 |
- trigger: ":localip" replace: "{{output}}" vars: - name: output type: shell params: cmd: "ip a | grep 'inet 192' | awk '{ print $2 }'" trim: false
|
デバッグ |
- trigger: ":localip" replace: "{{output}}" vars: - name: output type: shell params: cmd: "ip a | grep 'inet 192' | awk '{ print $2 }'" debug: true
|
日付拡張 |
- trigger: ":now" replace: "It's {{mytime}}" vars: - name: mytime type: date params: format: "%H:%M"
|
ランダム拡張 |
- trigger: ":quote" replace: "{{output}}" vars: - name: output type: random params: choices: - "Every moment is a fresh beginning." - "Everything you can imagine is real." - "Whatever you do, do it well."
|
クリップボード拡張 |
- trigger: ":a" replace: "$|$" vars: - name:"clipboard" type: "clipboard"
|
ローカル変数 |
- trigger: ":reversed" replace: "Reversed {{myshell}}" vars: - name: mytime type: date params: format: "%H:%M" - name: myshell type: shell params: cmd: "echo $ESPANSO_MYTIME | rev"
|
グローバル変数 |
global_vars: - name: "reversed" type: shell params: cmd: "echo $ESPANSO_VARNAME | rev"
matches: - trigger: ":rev" replace: "{{reversed}}" vars: - name: "varname" type: echo params: echo: "hello" - name: "reversed" type: "global"
|
フォーム |
- trigger: ":greet" form: | Hey {{name}}, Happy Birthday!
|
複数行 |
- trigger: ":greet" form: | Hey {{name}}, {{text}} Happy Birthday! form_fields: text: multiline: true
|
コンボボックス |
- trigger: ":form" form: | {{choices}} form_fields: choices: type: choice values: - First choice - Second choice
|
リスト |
- trigger: ":form" form: | {{choices}} form_fields: choices: type: list values: - First choice - Second choice
|
フォーム入力値の取得 |
- trigger: ":rev" replace: "{{reversed}}" vars: - name: form1 type: form params: layout: | Reverse {{name}} - name: reversed type: shell params: cmd: "echo $ESPANSO_FORM1_NAME | rev"
|
fields |
- trigger: ":form" replace: "Hey {{form1.name}}, how are you? Do you like {{form1.fruit}}?" vars: - name: "form1" type: form params: layout: "Name: {{name}} \nFruit: {{fruit}}" fields: name: multiline: true fruit: type: list # or choice values: - Apples - Bananas - Oranges - Peaches
|