Define chords (simultaneously pressed keys) for speedy typing! Video demo.
This plugin is heavily inspired by kana/vim-arpeggio.
Put the chord definitions in the arpeggio.chords
section of your config.cson
:
"*":
arpeggio:
chords:
fun: 'function'
Now, whenever you press f, u, n at the same time, you type the word function.
sd:
command: "editor:delete-to-beginning-of-word"
kl:
command: "editor:delete-to-beginning-of-word"
If you press the chord sd or kl, it will remove the last typed word. I use it when I want to delete a lot of text without moving my hands away from the home row.
con:
snippet: 'console.log($1)'
If you press the chord con, then console.log()
will be typed,
with the cursor between the parentheses.
Note: The snippets package must be activated in order for this feature to work.
kaw: "川"
kuc: "口"
del: "∆"
pri: "ʹ"
This allows you to type code like this very easily:
var ∆x = xʹ - x
the: "the"
If you press t, h, e at the same time, you will always get the word the, no matter in which order you pressed these keys.
"{}":
snippet: '''
{
$1
}
'''
If you press { and } at the same time,
you will get an empty curly braces block, with the cursor positioned at the $1
placeholder.
"*":
arpeggio:
chords:
<trigger>: <expansion>
trigger
is a string of keys that is used to trigger.expansion
is an expansion object or a string for simple text expansion.An expansion is a text with the following keys:
Key | Type | Description |
---|---|---|
text |
Action | The text to expand to. |
snippet |
Action | The snippet source to expand to. |
command |
Action | The command to invoke. |
timeout |
Option | The timeout in milliseconds. The keys in this particular chord must be pressed successively within the specified timeout in order for the chord to be triggered. This is useful when the chord is often accidentally triggered during normal typing. |