Changes

Jump to navigation Jump to search
69 bytes removed ,  19:04, 6 November 2016
no edit summary
Here are a few examples:
<pre>
func Eatchar(pat) " See :help abbreviations let c = nr2char(getchar(0)) return (c =~ a:pat) ? '' : cendfunc iab <buffer> ch. - \startchapter[title={<c-o>ma}]<cr><c-o>mb<cr>\stopchapter<esc>`a`b`aa<c-o>a<c-r>=Eatchar('\s')<cr>iab <buffer> s. - \startsection[title={<c-o>ma}]<cr><c-o>mb<cr>\stopsection<esc>`a`b`aa<c-o>a<c-r>=Eatchar('\s')<cr>iab <buffer> ss. - \startsubsection[title={<c-o>ma}]<cr><c-o>mb<cr>\stopsubsection<esc>`a`b`aa<c-o>a<c-r>=Eatchar('\s')<cr>iab <buffer> sss. - \startsubsubsection[title={<c-o>ma}]<cr><c-o>mb<cr>\stopsubsubsection<esc>`a`b`aa<c-o>a<c-r>=Eatchar('\s')<cr>iab <buffer> slide. - \startslide[title={<c-o>ma}]<cr><c-o>mb<cr>\stopslide<esc>`a`b`aa<c-o>a<c-r>=Eatchar('\s')<cr>iab <buffer> fig. - \startplacefigure<cr><tab>\externalfigure[<c-o>ma]%<cr>[]<c-o>mb<cr><c-d>\stopplacefigure<esc>`a`b`aa<c-o>a<c-r>=Eatchar('\s')<cr>iab <buffer> item. - \startitemize<cr><cr>\stopitemize<up><tab>\itemiab <buffer> enum. - \startitemize[n]<cr><cr>\stopitemize<up><tab>\itemiab <buffer> i. - \item
</pre>
Type the abbreviation followed by CTRL-] Space to expand the snippet, thencontinue 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. Try, for example, <tt>i.</tt> followed by CTRL-]and followed by Enter, to see the difference.
Inside the definition of an abbreviation, you marks may be set marks (see <tt>:h m</tt>), which allows allow you to jump between the differentparts of a snippet with TAB (CTRL-O i) and CTRL-I O (in Normal mode) when after the abbreviation is expanded (see <tt>:h jump-motions</tt>).For example, after typing <tt>ch.- </tt><c-]>, the cursor will be at the title's position. If you press <tt><esc><c-otab></tt> (or<tt><c-o><c-otab></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, or <tt><c-o></tt> to jumpat the end of the snippet.
=== Buffer-local Insert-mode macros to speed up editing ===
134

edits

Navigation menu