The Snippets plug-in allows you to insert words and phrases quickly. Save and recall your most frequently used pieces of code so that you never have to type something more than once.
The snippets plug-in allows you to insert words, phrases, and interactive pieces of code quickly, improving your speed and proficiency at creating documents. Snippets are pieces of text that you can insert into your document and may contain plain text, placeholders, shell code, macros, or regular expressions to transform text and various built-in and user-defined parameters. The Snippets plug-in allows multiple lines. The snippet tree includes not only snippets, but also macros. These macros don’t need to be saved as a file.
Snippets are very easy to use in EmEditor. To insert a snippet you need only type the assigned trigger string. Then a tooltip will appear; press TAB and the snippet will be auto-completed. You can view all of the available snippets by selecting the Snippets button on the Plug-ins toolbar. The default snippet tree includes pre-defined snippets, sorted into appropriate folders. Each one of these folders, and consequently the snippets within them, are associated with set configurations. To view these configurations next to the folder name, right click in the custom bar and under the view menu, select configurations. You can adjust the properties of the Snippets Plug-in by right-clicking the Snippets button on the Plug-ins toolbar and selecting Properties.
Types of Snippets:
Plain text – a word or phrase in plain text
Placeholders – Placeholders are pieces of code with blank spaces for inserting variables or parameters. After the snippet is inserted, the cursor will jump between the different placeholders, allowing you to enter the applicable values.
Mirrors – Mirrors are a specific type of placeholder for when you have multiple variables of the same value. Entering the value for the first placeholder will also enter the same value in the mirrored placeholders.
Shell Codes – Shell Codes run a console application and then pass strings to its standard input. The standard output, as well as the standard error, from the console application is redirected to the cursor position of your text document.
Macros – Use Macros with Snippets for easy access to frequent actions and other macro functions.