sponsor Vim development Vim logo Vim Book Ad

Minimd : A fast, folding Markdown outliner.

 script karma  Rating 17/5, Downloaded by 407  Comments, bugs, improvements  Vim wiki

created by
J. B.
 
script type
utility
 
description
Minimd is a Vim plugin that helps with writing long Markdown documents by folding sections and showing outlines of their contents.

The basic idea is that pressing spacebar on an unfolded level 1 header will fold that header, while pressing spacebar on a folded level 1 header will both unfold it and fold all the level 2 headers it contains. If you fold then unfold a level 3 header, any level 4 headers are folded, and so on. Pressing a number followed by the spacebar folds all headers of that number, which gives you an outline.

Minimd also has a few other features to make working with long documents easier:

- Header motion command that ignore code blocks (so don't mistake # comments for headers);
- Minimal syntax highlighting (headers, code blocks, square brackets, checkboxes, and the task markers ACTV, TODO, WAIT, CNCL, and DONE) so as not to be too distracting and to speed up the folding a bit
- Shortcuts to simultaneously change the levels of all headers within a fold
- A fast word count (in the status line by default) that updates only when toggling between insert and normal modes.

Usage is simple: <Space> folds and unfolds individual headers while [count]<Space> (i. e. "1" followed by spacebar) folds all headers at level [count].  When unfolding a specific header with level n, contained headers with level n+1 are folded, providing an outline of the unfolded header's contents.  Jumping to the next header can be done with <Tab> or ]h, and to the previous with <Shift-Tab> or [h; prefixing either movement with [count] jumps to the next header of level [count] in the given direction.
 
install details
Just copy the vim-minimd directory to ~/.vim/pack/plugins/start.

The included syntax file only specifies headers, code blocks, and task management entities.  If you would like to use Minimd with Vim's default syntax (which will be around 3x slower in my experience), `let g:default_markdown_syntax = 1` in your `vimrc`.

This plugin is developed at https://github.com/shushcat/vim-minimd, so the most recent version will appear there; only versions with significant bug fixes or changes to functionality will be posted here.
 

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
minimd.tar.gz 1.4 2022-05-19 7.0 J. B. Fix a bug that excluded empty headers appearing at the ends of files from their parent folds.
minimd.tar.gz 1.3 2021-12-16 7.0 J. B. Fix header search regular expression for substantial speedup.
minimd.tar.gz 1.2 2021-07-30 7.0 J. B. Allow using default Markdown syntax.  Jump to headers of specified number.
minimd.tar.gz 1.1 2021-06-26 7.0 J. B. Allows unfolding at the location of a search inside a folded region.
minimd.tar.gz 1.0 2021-06-13 7.0 J. B. Initial upload
ip used for rating: 3.145.58.169

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.
   
Vim at Github