Changes

Jump to navigation Jump to search
347 bytes added ,  20:34, 27 April 2017
no edit summary
Snippets are predefined code or text blocks. Using snippets can save a lot of time as you won't have to retype often used commands and text passages. You add snippets to your <code>USER/.textadept/init.lua</code>. In Textadept snippets look like this:
snippets.context['TRIGGERKEYWORD'] = 'PASTEDTEXT'
 
To get an idea how writing snippets in Lua for ConTeXt works, you can copy paste the following list to your <code>init.lua</code>:
-- The first line is mandatory:
snippets['context'] = snippets['context'] or {}
-- Snippets start here:
snippets.context['emph'] = '{\\em %<selected_text>%0}'-- emphasized text/math snippets.context['ital'] = '{\\it %<selected_text>%0}' -- italic text/math snippets.context['bold'] = '{\\bf %<selected_text>%0}'-- bold text/math snippets.context['bold'] = '{\\bi %<selected_text>%0}' -- bold italic text/math
snippets.context['start'] = '\\start%1\n\t%0\n\\stop%1'
snippets.context['itemize'] = '\\startitemize[packed]\n\t\\startitem\n\t\t%<selected_text>%0\n\t\\stopitem\n\\stopitemize' -- start itemization
194

edits

Navigation menu