22
33This plugin adds some spice to the bundled [ vim-markdown] [ 3 ] , such as:
44
5- - Easy toggle italic, bold, strike-through, code delimiters ,
5+ - Easy toggle italic, bold, strike-through, code text-styles ,
66- Easy to add/jump/remove/preview links,
77- Toggle quoted and code blocks,
88- Format with ` gq ` and on save,
99- Render with ` pandoc ` ,
10- - Easy configuration and usage
1110- ... and more.
1211
1312# Requirements
@@ -20,17 +19,19 @@ lines:
2019 filetype indent plugin on
2120 syntax on
2221```
23- To enable the rendering feature, you need to install [ pandoc] [ 1 ] .
24- To automatically open the rendered files, Vim must have the ` :Open ` command.
2522
26- To enable the formatting feature, you need to install [ prettier] [ 2 ] or any other
27- formatting program of your choice.
23+ The following is not mandatory, but you want to enable the rendering feature,
24+ you need to install [ pandoc] [ 1 ] . To automatically open the rendered files, Vim
25+ must have the ` :Open ` command.
26+
27+ Along the same line, to enable the formatting feature, you need to install
28+ [ prettier] [ 2 ] or any other formatting program of your choice.
2829
2930# Usage
3031
3132To best way to describe how to operate it, let's go through some examples.
3233
33- ## Text-styles
34+ ### Text-styles
3435
3536Open a markdown file and place the cursor on a word.
3637Hit ` <localleader>biw ` to change the text-style inside-the-word
@@ -46,7 +47,7 @@ not persistent. As usual, you can remove the highlight with `<localleader>d`.
4647
4748See ` markdown-extras-mappings ` for all the possible text styles.
4849
49- ## Links
50+ ### Links
5051
5152Now, place the cursor on a word and hit ` <enter> ` .
5253Select ` Create new link ` from the popup menu and point to an existing
@@ -76,14 +77,14 @@ comment line.
7677>
7778> The links management only applies to links reported after the
7879> ` <!-- DO NOT REMOVE vim-markdown-extras references DO NOT REMOVE--> `
79- > comment line.
80+ > comment line. Such a line shall be unique in the buffer.
8081
81- ## Lists
82+ ### Lists
8283
8384You can create lists or enumerations as usual. However, the behavior of the
8485` <enter> ` key is hacked to mimic the behavior of Microsoft products and
8586respect possible nesting. Although there are many reasons to stick with the
86- bundled ` ft -markdown-plugin ` behavior when it comes to lists,
87+ bundled [ vim -markdown] [ 3 ] behavior when it comes to lists,
8788my use-cases and preferences require a different behavior. At the end Vim is a
8889matter of customizing everything to your workflow, no? :)
8990
@@ -96,7 +97,7 @@ to-do list with `<localleader>x`.
9697> If you have ` vim-outline ` installed, then you can use ` <localleader>o ` to
9798> display the unchecked items of the to-do list in a scratch buffer.
9899
99- ## Formatting
100+ ### Formatting
100101
101102You can format text as usual by using ` gq ` .
102103Here ` gq ` uses ` prettier ` , provided that you have it installed.
@@ -105,7 +106,7 @@ then hit `gq`, then `prettier` will only prettify such a portion of text. You
105106can also prettify the whole buffer on save, see ` markdown-extras-config ` how
106107to do that.
107108
108- ## Rendering
109+ ### Rendering
109110
110111You can then use ` :make ` to render your buffer with ` pandoc ` , provided that
111112you have ` pandoc ` installed.
@@ -129,7 +130,7 @@ You could for example set the following:
129130>
130131> The rendered file will automatically open if your Vim has the ` :Open ` command.
131132
132- ## Indices
133+ ### Indices
133134
134135As the plugin can be used for note-taking, it may be desirable to access
135136different indices in an ergonomic way. This can be achieved with the
@@ -139,7 +140,30 @@ command.
139140For more information about key-bindings, configuration, etc. take
140141a look at ` :h markdown-extras ` .
141142
142- ## License
143+ ### Limitations
144+
145+ Nothing is perfect, and this plugin is no exception. Here are some random
146+ limitations:
147+
148+ - Markdown is not a regular language, and many features rely on regular
149+ expressions. This means there will always be corner cases where some features
150+ fail. Parsing non-regular languages requires more advanced tools like
151+ Tree-sitter. However, it is generally not a good idea to "punish" all use
152+ cases with slow and memory-hungry solutions just for a few edge cases that
153+ likely occur very sporadically. I prefer efficiency and speed for most use
154+ cases, and for the others... well, patience!
155+
156+ - The plugin somewhat forces the use of reference-style links where the
157+ reference identifier is a number. You could try using strings as reference
158+ identifiers, but I won't guarantee that everything will work fine.
159+
160+ - The link management system heavily relies on the content below the
161+ "<!-- DO NOT REMOVE vim-markdown-extras references DO NOT REMOVE --> "
162+ comment. That comment must be unique. Attempting to pick links randomly
163+ scattered throughout the buffer using regular expressions would most likely
164+ lead to the issue described in the first bullet point.
165+
166+ ### License
143167
144168BSD-3.
145169
0 commit comments