The AST clipboard is a dedicated clipboard for use with AST editing commands such as
wrap. Selections that are cut and may need to be re-inserted elsewhere, potentially with some intermediate steps beforehand, are placed into this clipboard.
To insert the contents of the AST clipboard, press
Alt+i. This replaces the selected lines with the clipboard contents.
AST mode and normal mode can coordinate via the AST clipboard and snippets in order to implement multi-step edits. For example, to wrap the selection in an
From normal mode, select the code to wrap and press
Tabto insert the
Fill in the condition.
Tab to the body.
Alt+ito insert the original selection.
Alt+oto move the cursor to the end of the
ifsnippet. This works even if the snippet doesn’t have an explicit
@$tabstop at the end.