Indentation plugin
$ yarn add @aomao/plugin-indent
Add to engine
This plugin is recommended to be added first to prevent other plugins from intercepting the event and making it unable to take effect
import Engine, {EngineInterface} from'@aomao/engine';import Indent from'@aomao/plugin-indent';new Engine(...,{ plugins:[Indent] })
Default indentation shortcut mod+]
Delete indentation shortcut key mod+[
by default
//hotkey,hotkey?: {in?:string //Indentation shortcut key, default mod+]out?:string //Delete indentation shortcut key, default mod+[};//Use configurationnew Engine(...,{config:{"indent":{//Modify shortcut keyshotkey:{"in":"shortcut key","out": "shortcut key"}}}})
Maximum padding, each indentation is 2
maxPadding?:number
One parameter defaults to in
, optional value is in
to increase indentation, and out
to decrease indentation
engine.command.execute('indent');//Use command to execute query current status, return numbber, current indentation valueengine.command.queryState('indent');