Super Simple MACRO
Super Simple Macro will give you a few of simple commands and execute a macro file for Visual Studio Code.
Of course, you can use a few of simple commands given by this extension and commands of Visual Studio Code with a macro file.
Commands
- Super Simple Macro
- command: ssmacro.macro
- parameter : should set file or path prameter.
- file string (This is Macro file name(ext. installed dir + /macros/ + 'file'). not set is error)
- path string (This is Macro file name(full path). not set is error)
- Super Simple Run
- command: ssmacro.run
- parameter: [prompt string] (input box title(default:"macro file name").)
- Super Simple Cursor Left(alias 'cursorLeft' command)
- command: ssmacro.left
- parameter: [count num[1-10000]] (This is loop count. not set is 1)
- Super Simple Cursor Right(alias 'cursorRight' command)
- command: ssmacro.right
- parameter: [count num[1-10000]] (This is loop count. not set is 1)
- Super Simple Cursor Up(alias 'cursorUp' command)
- command: ssmacro.up
- parameter: [count num[1-10000]] (This is loop count. not set is 1)
- Super Simple Cursor Down(alias 'cursorDown' command)
- command: ssmacro.down
- parameter: [count num[1-10000]] (This is loop count. not set is 1)
- Super Simple Input
- command: ssmacro.input
- parameter: [prompt string] ssmacro.Input.parameter
- Super Simple Copy not Clipboard
- command: ssmacro.copy
- parameter: none
- Super Simple Cut not Clipboard
- command: ssmacro.cut
- parameter: none
- Super Simple Paste not Clipboard
- command: ssmacro.paste
- parameter: [index num] (This is copy index number. not set is last copy)
- Super Simple Insert characters
- command: ssmacro.insert
- parameter:
- characters string (This is insert letters. not set is error)
- [position [left|right|start|end]] (This is insert position. not set or parameter error is cursor position or selected position)
- Super Simple Replace find to replace value
- command: ssmacro.replace
- parameter:
- find string (This is find letters. not set is error)
- replace string (This is replace letters. not set is error)
- [all [true|false]] (This is replace range. not set or parameter error is the selected range)
- [reg [true|false]] (This is regular expression of find. not set or parameter error is not regular)
- [flag string] (This is regular expression flags. not checked)
- Super Simple Paste from Clipboard
- command: ssmacro.pasteFromClipboard
- parameter: none
- Super Simple Copy buffer Clear not Clipboard
- command: ssmacro.clear
- parameter: none
Macro File
Macro File is JSON format. But you shoould not insert any comments in macro file.
For example:
[
"ssmacro.clear",
"ssmacro.copy",
{
"args":
{
"characters": "<tag>"
},
"command": "ssmacro.insert"
},
"ssmacro.paste",
{
"args":
{
"characters": "</tag>"
},
"command": "ssmacro.insert"
},
{
"args":
{
"count": 4
},
"command": "ssmacro.left"
}
]
The executing image by the exmaple macro file.
Note: you can set only command when unnecessary parameters.
Also you can use commands of Visual Studio Code. (i.e, "type" , "editor.action.addCommentLine" etc., )
Keybinding
You can use your macro file by short cut key.
You will set in keybindings.json (Code|File > Preferences > Keyboard Shortcuts) add binding to your macros:
{
"key": "ctrl+9",
"command": "ssmacro.macro", "args": {"file": "sample_tag.json"}
}
Note: "sample_tag.json" should exist in this extension installed directory + '/macros/'.
or
{
"key": "ctrl+9",
"command": "ssmacro.macro", "args": {"path": "/home/hoge/sample_tag.json"}
}
Note: "path" parameter must be full path.
Known Issues
none.
License
MIT
Release Notes
0.6.0
- Add command of "ssmacro.run".
- Bug fix for "await" nothing.
0.5.0
Beta trial.