Markdown Plugin
Use plasticboy/vim-markdown for vim. This plugin enable markdown syntax highlighting, folding/unfolding and some navigation shortcuts.
Install and Config
Add the following lines into .vimrc
:
let g:vim_markdown_folding_level = 3
let g:vim_markdown_toc_autofit = 1
nnoremap <leader>t :Toc<CR>
Plugin 'godlygeek/tabular'
Plugin 'plasticboy/vim-markdown'
Frequently used shortcuts
,t
or :Toc
: show table of contents window;
Fold
- zc: close one more level fold at cursor (local version of
zm
); - zo: open one more level fold at cursor (local version of
zr
); -
za: toggle open/close at cursor;
-
zn: unfold all folds(at all levels,
n
for none); -
zm: fold one more level in document scope (global version of
zc
,m
for more); -
zr: unfold one more level in document scope (global version of
zo
,r
for reduce) -
zj: go to the next fold;
-
zk: go to the previous fold;
-
[z: go to the start of the fold at cursor;
- ]z: go to the end of the fold at cursor;
Markdown
- ]]: go to next header;
- [[: go to previous header;
- ]c: go to current header;
- ]u: go to parent header;