You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+83-24Lines changed: 83 additions & 24 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,16 +4,43 @@ This extension can create command sequence as one command and bind a key, or cal
4
4
5
5
## Features
6
6
7
-
* create command sequence as one command and bind a key.
8
-
* call command sequence manually.
9
-
* set interval between each command execution.
7
+
- create command sequence as one command and bind a key.
8
+
- call command sequence manually.
9
+
- set interval between each command execution.
10
10
11
11
## Extension Settings
12
12
13
-
Settings has 2 steps.
13
+
There is simple usage that uses only keybindings.json and a usage that uses settings.json.
14
+
15
+
### Simple Usage with keybindings.json
16
+
17
+
In keybindings.json, bind a key to `extension.multiCommand.execute` with passing a command sequence you want to execute as the argument.
18
+
For example:
19
+
20
+
```json
21
+
{
22
+
"key": "alt+x",
23
+
"command": "extension.multiCommand.execute",
24
+
"args": {
25
+
"sequence": [
26
+
"cursorDown",
27
+
"cursorDown",
28
+
"cursorDown"
29
+
]
30
+
}
31
+
}
32
+
```
33
+
This command sequence executes "cursorDown" command 3 times.
34
+
35
+
### Usage with settings.json.
36
+
37
+
This usage is useful for resusing the defined command sequence in another command sequnce or executing the sequence manually.
38
+
39
+
In case using settings.json, the settings has 2 steps.
14
40
15
41
1. Create command sequence as one command in settings.json.
16
42
For example:
43
+
17
44
```json
18
45
"multiCommand.commands": [
19
46
{
@@ -36,22 +63,38 @@ Settings has 2 steps.
36
63
}
37
64
]
38
65
```
66
+
39
67
First sequence is named "multiCommand.down3Lines" and executes "cursorDown" command 3 times.
40
68
41
69
Second sequence is named "multiCommand.swapChar". This sequence swaps cursor's left character and the right character. If a command is executed asynchronousely, you can set time interval between each command execution using "interval" configuration(milliseconds).
42
70
71
+
You can also use an object style that uses the command name as a key instead of an array.
72
+
```json
73
+
"multiCommand.commands": {
74
+
"multiCommand.down3Lines": {
75
+
"sequence": [
76
+
"cursorDown",
77
+
"cursorDown",
78
+
"cursorDown"
79
+
]
80
+
}
81
+
}
82
+
```
83
+
This style is useful when you want to merge user settings and the workspace settings.
84
+
43
85
2. Bind a key to created command sequence in keybindings.json.
But when you use this key bind style, Visual Studio Code may warn about the command name. see: https://github.com/ryuta46/vscode-multi-command/issues/16
68
121
69
122
### Manual Execution
@@ -77,17 +130,19 @@ You can call a defined command sequence from command palette.
77
130
If you want to call a command sequence in shorter steps, bind a key to "extension.multiCommand.execute".
78
131
79
132
For example:
133
+
80
134
```json
81
-
{
82
-
"key": "cmd+shift+m",
83
-
"command": "extension.multiCommand.execute"
84
-
}
135
+
{
136
+
"key": "cmd+shift+m",
137
+
"command": "extension.multiCommand.execute"
138
+
}
85
139
```
86
140
87
141
If you set `label` and `description` parameters in settings.json, they are displayed when you choose a command sequence.
0 commit comments