Changes

Jump to navigation Jump to search
704 bytes added ,  16:11, 6 November 2016
Update abbreviations
Vim allows you to define abbreviations for frequently used pieces of text (see <tt>:help abbreviations</tt>).
Here are a few examples:
iab <buffer> ch. \startchapter[title={<c-o>ma}]<cr>\stopchapter<up><c-o>f}mb<cr>\stopchapter<esc>`b`aa iab <buffer> s. \startsection[title={<c-o>ma}]<cr>\stopsection<up><c-o>f}mb<cr>\stopsection<esc>`b`aa iab <buffer> ss. \startsubsection[title={<c-o>ma}]<cr>\stopsubsection<up><c-o>f}mb<cr>\stopsubsection<esc>`b`aa iab <buffer> sss. \startsubsubsection[title={<c-o>ma}]<cr><c-o>mb<cr>\stopsubsubsection<upesc>`b`aa iab <buffer> slide. \startslide[title={<c-o>fma}]<cr><c-o>mb<cr>\stopslide<esc>`b`aa iab <buffer> fig. \startplacefigure<cr><crtab>\stopplacefigureexternalfigure[<upc-o>ma]%<tabcr>\externalfigure[][]<c-o>2mb<cr><c-d>\stopplacefigure<leftesc>`b`aa
iab <buffer> item. \startitemize<cr><cr>\stopitemize<up><tab>\item
iab <buffer> enum. \startitemize[n]<cr><cr>\stopitemize<up><tab>\item
iab <buffer> i. \item
 
Type the abbreviation (including the dot) followed by CTRL-] to expand the snippet, then
continue typing normally.
Abbreviations may be triggered by any other non-keyword character (different from CTRL-]),
but in that case such character is inserted in the text.
 
Inside the definition of an abbreviation, you may set marks, which allows you to jump between the different
parts of a snippet with CTRL-O and CTRL-I (in Normal mode) when the abbreviation is expanded. For example,
after typing <tt>ch.<c-]></tt>, the cursor will be at the title's position. If you press <tt><esc><c-o></tt> (or
<tt><c-o><c-o></tt> if you want to stay in Insert mode after the jump), you will jump between <tt>\startchapter</tt>
and <tt>\stopchapter</tt>. You may use <tt><c-i></tt> (in Normal mode) to jump back.
 
=== Buffer-local Insert-mode macros to speed up editing ===
134

edits

Navigation menu