1 *asciidoc-folding.txt* For Vim version 7.3 Last change: 2014 Sep 03 |
|
2 |
|
3 Original Author: Drew Neil <http://drewneil.com/> |
|
4 Author: Matthew Todd <http://github.com/matcatc> |
|
5 License: Same terms as Vim itself (see |license|) |
|
6 |
|
7 CONTENTS *asciidoc-folding* |
|
8 |
|
9 Introduction |asciidoc-folding-introduction| |
|
10 Stacked folding |asciidoc-folding-stacked| |
|
11 Nested folding |asciidoc-folding-nested| |
|
12 Configuration |asciidoc-folding-configuration| |
|
13 Overriding the default style |g:asciidoc_fold_style| |
|
14 Switching fold style |asciidoc-folding-:FoldToggle| |
|
15 |
|
16 ============================================================================ |
|
17 INTRODUCTION *asciidoc-folding-introduction* |
|
18 |
|
19 This plugin, originally based on Drew Niel's vim-markdown-folding, enables you |
|
20 to fold asciidoc documents by section headings. It recognizes only the |
|
21 Atx-style of headings, as shown below (and described at |
|
22 http://asciidoctor.org/docs/asciidoc-recommended-practices/). |
|
23 |
|
24 == section level 1 |
|
25 |
|
26 === section level 2 |
|
27 |
|
28 ==== section level 3 |
|
29 |
|
30 ===== section level 4 |
|
31 |
|
32 The alternative Setext style is not currently supported. |
|
33 |
|
34 Two different folding styles are supported: stacked (the default) and nested. |
|
35 |
|
36 *asciidoc-folding-stacked* |
|
37 The stacked folding style creates a flat list of sections. When all folds are |
|
38 closed, the outline resembles a fully expanded table of contents. That is, h1, |
|
39 h2, h3 etc. headings are all represented equally. |
|
40 |
|
41 Implementation details: all sections (h1, h2, h3 etc.) initiate a fold with |
|
42 foldlevel=1. |
|
43 |
|
44 *asciidoc-folding-nested* |
|
45 The nested folding style creates a heirarchical list of sections. When all |
|
46 folds are closed (by pressing |zM| or running :set foldlevel=0), the outline |
|
47 resembles a table of contents (ToC) that only shows h1 sections. |
|
48 |
|
49 Opening the h1 folds (by running :set foldlevel=1) reveals the content of that |
|
50 section, with any h2 sections outlined as a ToC. |
|
51 |
|
52 Opening an h2 fold (by running :set foldlevel=2) reveals the content of that |
|
53 section, with any h3 sections outlined as a ToC. And so on... |
|
54 |
|
55 Implementation details: h1 sections initiate a fold with foldlevel=1, h2 |
|
56 sections initiate a fold with foldlevel=2, and so on. |
|
57 |
|
58 ============================================================================ |
|
59 CONFIGURATION *asciidoc-folding-configuration* |
|
60 |
|
61 The stacked folding style is the default. |
|
62 *g:asciidoc_fold_style* |
|
63 To make the nested folding style the default, put this in your |vimrc| |
|
64 file:> |
|
65 let g:asciidoc_fold_style = 'nested' |
|
66 < |
|
67 |
|
68 *asciidoc-folding-:FoldToggle* |
|
69 You can switch between the stacked and nested folding styles by running |
|
70 the command:> |
|
71 :FoldToggle |
|
72 < |
|
73 |
|
74 The fold style is scoped to each window, which means it's possible to use the |
|
75 stacked folding style in one split window, and the nested folding style in |
|
76 another. |
|
77 |
|
78 *g:asciidoc_fold_override_foldtext* |
|
79 If set to 0, the fold text will not be overriden:> |
|
80 let g:asciidoc_fold_override_foldtext = 0 |
|
81 < |
|
82 |
|
83 vim:tw=78:ts=8:ft=help:norl: |
|
84 |
|