Skip to content

Commit 1757bf6

Browse files
committed
Document text folding of headers (issue #106)
NB: I've decided to start including screen shots in version control because there isn't a better place to keep them...
1 parent 23b4f1e commit 1757bf6

File tree

4 files changed

+50
-41
lines changed

4 files changed

+50
-41
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,12 @@ The vim-notes plug-in for the [Vim text editor] [vim] makes it easy to manage yo
1515
* **Back-references:** The `:RelatedNotes` command find all notes referencing the current file
1616
* A [Python 2] [python] script is included that accelerates keyword searches using a keyword index
1717
* The `:RecentNotes` command lists your notes by modification date, starting with the most recently edited note
18+
* **Navigating within notes:** The vim-notes syntax uses atx-style headers just like [Markdown] [markdown] (one to six `#` marks at the start of the line) and supports text folding based on these headers. This allows easy navigation within notes that contain large (and possibly nested) sections of text separated by headers. [Here's a screen shot of text folding] [folding].
1819
* **Navigating between notes:** The included syntax script highlights note names as hyper links and the file type plug-in redefines [gf] [gf] to jump between notes (the [Control-w f] [ctrlwf] mapping to jump to a note in a split window and the [Control-w gf] [ctrlwgf] mapping to jump to a note in a new tab page also work)
1920
* **Writing aids:** The included file type plug-in contains mappings for automatic curly quotes, arrows and list bullets and supports completion of note titles using Control-X Control-U and completion of tags using Control-X Control-O
2021
* **Embedded file types:** The included syntax script supports embedded highlighting using blocks marked with `{{{type … }}}` (triple back ticks ala [GFM] [gfm] are also supported) which allows you to embed highlighted code and configuration snippets in your notes
2122

22-
Here's a screen shot of the syntax mode using the [Slate] [slate] color scheme and the font [Monaco] [monaco]:
23+
Here's a screen shot of the syntax mode (using the [Slate] [slate] color scheme and the [Monaco] [monaco] font):
2324

2425
![Syntax mode screen shot](http://peterodding.com/code/vim/notes/syntax.png)
2526

@@ -365,6 +366,7 @@ This software is licensed under the [MIT license] [mit].
365366
[download-notes]: http://peterodding.com/code/vim/downloads/notes.zip
366367
[edit]: http://vimdoc.sourceforge.net/htmldoc/editing.html#:edit
367368
[enc]: http://vimdoc.sourceforge.net/htmldoc/options.html#'encoding'
369+
[folding]: https://raw.githubusercontent.com/xolox/vim-notes/master/screenshots/folding.png
368370
[geshi]: http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi
369371
[gf]: http://vimdoc.sourceforge.net/htmldoc/editing.html#gf
370372
[gfm]: https://help.github.com/articles/github-flavored-markdown/

doc/notes.txt

+47-40
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@ notes in Vim:
106106
- The |:RecentNotes| command lists your notes by modification date, starting
107107
with the most recently edited note
108108

109+
- **Navigating within notes:** The vim-notes syntax uses atx-style headers
110+
just like Markdown [3] (one to six '#' marks at the start of the line) and
111+
supports text folding based on these headers. This allows easy navigation
112+
within notes that contain large (and possibly nested) sections of text
113+
separated by headers. Here's a screen shot of text folding [4].
114+
109115
- **Navigating between notes:** The included syntax script highlights note
110116
names as hyper links and the file type plug-in redefines |gf| to jump
111117
between notes (the Control-w f (see |CTRL-W_f|) mapping to jump to a note
@@ -119,13 +125,13 @@ notes in Vim:
119125

120126
- **Embedded file types:** The included syntax script supports embedded
121127
highlighting using blocks marked with '{{{type … }}}' (triple back ticks
122-
ala GFM [3] are also supported) which allows you to embed highlighted code
128+
ala GFM [5] are also supported) which allows you to embed highlighted code
123129
and configuration snippets in your notes
124130

125-
Here's a screen shot of the syntax mode using the Slate [4] color scheme and
126-
the font Monaco [5]:
131+
Here's a screen shot of the syntax mode (using the Slate [6] color scheme and
132+
the Monaco [7] font):
127133

128-
Image: Syntax mode screen shot (see reference [6])
134+
Image: Syntax mode screen shot (see reference [8])
129135

130136
===============================================================================
131137
*notes-install-usage*
@@ -134,16 +140,16 @@ Install & usage ~
134140
_Please note that the vim-notes plug-in requires my vim-misc plug-in which is
135141
separately distributed._
136142

137-
Unzip the most recent ZIP archives of the vim-notes [7] and vim-misc [8] plug-
143+
Unzip the most recent ZIP archives of the vim-notes [9] and vim-misc [10] plug-
138144
ins inside your Vim profile directory (usually this is '~/.vim' on UNIX and
139145
'%USERPROFILE%\vimfiles' on Windows), restart Vim and execute the command
140146
':helptags ~/.vim/doc' (use ':helptags ~\vimfiles\doc' instead on Windows). To
141147
get started execute |:Note| or ':edit note:', this will start a new note that
142148
contains instructions on how to continue from there (and how to use the plug-in
143149
in general).
144150

145-
If you prefer you can also use Pathogen [9], Vundle [10] or a similar tool to
146-
install & update the vim-notes [11] and vim-misc [12] plug-ins using a local
151+
If you prefer you can also use Pathogen [11], Vundle [12] or a similar tool to
152+
install & update the vim-notes [13] and vim-misc [14] plug-ins using a local
147153
clone of the git repository.
148154

149155
===============================================================================
@@ -170,7 +176,7 @@ circumstances but should work for most people:
170176

171177
- If the profile directory where the plug-in is installed is writable, the
172178
directory 'misc/notes/user' under the profile directory is used. This is
173-
for compatibility with Pathogen [9]; the notes will be stored inside the
179+
for compatibility with Pathogen [11]; the notes will be stored inside the
174180
plug-in's bundle.
175181

176182
- If the above doesn't work out, the default depends on the platform:
@@ -327,7 +333,7 @@ recreate it manually by executing |:IndexTaggedNotes| (see below).
327333
-------------------------------------------------------------------------------
328334
The *g:notes_markdown_program* option
329335

330-
The |:NoteToHtml| command requires the Markdown [13] program. By default the
336+
The |:NoteToHtml| command requires the Markdown [3] program. By default the
331337
name of this program is assumed to be simply 'markdown'. If you want to use a
332338
different program for Markdown to HTML conversion, set this option to the name
333339
of the program.
@@ -516,7 +522,7 @@ If for any reason you want to recreate the list of tags you can execute the
516522
The *:NoteToHtml* command
517523

518524
This command converts the current note to HTML. It works by first converting
519-
the current note to Markdown [13] and then using the 'markdown' program to
525+
the current note to Markdown [3] and then using the 'markdown' program to
520526
convert that to HTML. It requires an external program to convert Markdown to
521527
HTML. By default the program 'markdown' is used, but you can change the name of
522528
the program using the |g:notes_markdown_program| option. To convert your note
@@ -536,7 +542,7 @@ optimized for speed (yet).
536542
-------------------------------------------------------------------------------
537543
The *:NoteToMarkdown* command
538544

539-
Convert the current note to a Markdown document [13]. The vim-notes syntax
545+
Convert the current note to a Markdown document [3]. The vim-notes syntax
540546
shares a lot of similarities with the Markdown text format, but there are some
541547
notable differences, which this command takes care of:
542548

@@ -557,7 +563,7 @@ optimized for speed (yet).
557563
-------------------------------------------------------------------------------
558564
The *:NoteToMediawiki* command
559565

560-
Convert the current note to a Mediawiki document [14]. This is similar to the
566+
Convert the current note to a Mediawiki document [15]. This is similar to the
561567
|:NoteToMarkdown| command, but it produces wiki text that can be displayed on a
562568
Mediawiki site. That being said, the subset of wiki markup that vim-notes
563569
actually produces will probably work on other wiki sites. These are the notable
@@ -570,7 +576,7 @@ transforations:
570576

571577
- Preformatted blocks are output into '<syntaxhighlight lang="..">' tags.
572578
This functionality is enabled on Mediawiki through the SyntaxHighlight
573-
GeSHi extention [15]. It is also supported on Wikipedia.
579+
GeSHi extention [16]. It is also supported on Wikipedia.
574580

575581
===============================================================================
576582
*notes-mappings*
@@ -659,14 +665,14 @@ Other plug-ins that work well with the notes plug-in ~
659665
*notes-utl.vim*
660666
utl.vim ~
661667

662-
The utl.vim [16] universal text linking plug-in enables links between your
668+
The utl.vim [17] universal text linking plug-in enables links between your
663669
notes, other local files and remote resources like web pages.
664670

665671
-------------------------------------------------------------------------------
666672
*notes-shell.vim*
667673
shell.vim ~
668674

669-
My shell.vim [17] plug-in also enables easy navigation between your notes and
675+
My shell.vim [18] plug-in also enables easy navigation between your notes and
670676
environment like local files and directories, web pages and e-mail addresses by
671677
providing key mappings and commands to e.g. open the file/URL under the text
672678
cursor. This plug-in can also change Vim to full screen which can be really
@@ -676,7 +682,7 @@ nice for large notes.
676682
*notes-voom*
677683
VOoM ~
678684

679-
The VOoM [18] outlining plug-in should work well for notes if you use the
685+
The VOoM [19] outlining plug-in should work well for notes if you use the
680686
Markdown style headers starting with '#', however it has been reported that
681687
this combination may not always work so well in practice (sometimes losing
682688
notes!)
@@ -686,7 +692,7 @@ notes!)
686692
Txtfmt ~
687693

688694
If the text formatting supported by the notes plug-in is not enough for you,
689-
consider trying the Txtfmt [19] (The Vim Highlighter) plug-in. To use the two
695+
consider trying the Txtfmt [20] (The Vim Highlighter) plug-in. To use the two
690696
plug-ins together, create the file 'after/ftplugin/notes.vim' inside your Vim
691697
profile with the following contents:
692698
>
@@ -702,7 +708,7 @@ absolute pathnames that most certainly won't match between e.g. Windows and
702708
Linux or even Windows and Cygwin. The best you can do is keep separate session
703709
scripts for different platforms (and I would certainly consider Cygwin a
704710
separate platform altogether :-). For more information please refer to issue
705-
#85 [20].
711+
#85 [21].
706712

707713
===============================================================================
708714
*notes-contact*
@@ -711,13 +717,13 @@ Contact ~
711717
If you have questions, bug reports, suggestions, etc. the author can be
712718
contacted at [email protected]. The latest version is available at
713719
http://peterodding.com/code/vim/notes/ and http://github.com/xolox/vim-notes.
714-
If you like the script please vote for it on Vim Online [21].
720+
If you like the script please vote for it on Vim Online [22].
715721

716722
===============================================================================
717723
*notes-license*
718724
License ~
719725

720-
This software is licensed under the MIT license [22]. © 2015 Peter Odding
726+
This software is licensed under the MIT license [23]. © 2015 Peter Odding
721727
722728

723729
===============================================================================
@@ -726,25 +732,26 @@ References ~
726732

727733
[1] http://en.wikipedia.org/wiki/Levenshtein_distance
728734
[2] http://python.org/
729-
[3] https://help.github.com/articles/github-flavored-markdown/
730-
[4] http://code.google.com/p/vim/source/browse/runtime/colors/slate.vim
731-
[5] http://en.wikipedia.org/wiki/Monaco_(typeface)
732-
[6] http://peterodding.com/code/vim/notes/syntax.png
733-
[7] http://peterodding.com/code/vim/downloads/notes.zip
734-
[8] http://peterodding.com/code/vim/downloads/misc.zip
735-
[9] http://www.vim.org/scripts/script.php?script_id=2332
736-
[10] https://github.com/gmarik/vundle
737-
[11] http://github.com/xolox/vim-notes
738-
[12] http://github.com/xolox/vim-misc
739-
[13] http://en.wikipedia.org/wiki/Markdown
740-
[14] https://www.mediawiki.org/wiki/MediaWiki
741-
[15] http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi
742-
[16] http://www.vim.org/scripts/script.php?script_id=293
743-
[17] http://www.vim.org/scripts/script.php?script_id=3123
744-
[18] http://www.vim.org/scripts/script.php?script_id=2657
745-
[19] http://www.vim.org/scripts/script.php?script_id=2208
746-
[20] https://github.com/xolox/vim-session/issues/85
747-
[21] http://www.vim.org/scripts/script.php?script_id=3375
748-
[22] http://en.wikipedia.org/wiki/MIT_License
735+
[3] http://en.wikipedia.org/wiki/Markdown
736+
[4] https://raw.githubusercontent.com/xolox/vim-notes/master/screenshots/folding.png
737+
[5] https://help.github.com/articles/github-flavored-markdown/
738+
[6] http://code.google.com/p/vim/source/browse/runtime/colors/slate.vim
739+
[7] http://en.wikipedia.org/wiki/Monaco_(typeface)
740+
[8] http://peterodding.com/code/vim/notes/syntax.png
741+
[9] http://peterodding.com/code/vim/downloads/notes.zip
742+
[10] http://peterodding.com/code/vim/downloads/misc.zip
743+
[11] http://www.vim.org/scripts/script.php?script_id=2332
744+
[12] https://github.com/gmarik/vundle
745+
[13] http://github.com/xolox/vim-notes
746+
[14] http://github.com/xolox/vim-misc
747+
[15] https://www.mediawiki.org/wiki/MediaWiki
748+
[16] http://www.mediawiki.org/wiki/Extension:SyntaxHighlight_GeSHi
749+
[17] http://www.vim.org/scripts/script.php?script_id=293
750+
[18] http://www.vim.org/scripts/script.php?script_id=3123
751+
[19] http://www.vim.org/scripts/script.php?script_id=2657
752+
[20] http://www.vim.org/scripts/script.php?script_id=2208
753+
[21] https://github.com/xolox/vim-session/issues/85
754+
[22] http://www.vim.org/scripts/script.php?script_id=3375
755+
[23] http://en.wikipedia.org/wiki/MIT_License
749756

750757
vim: ft=help

screenshots/folding.png

118 KB
Loading

screenshots/syntax.png

71.5 KB
Loading

0 commit comments

Comments
 (0)