# Vim Markdown
-[](https://travis-ci.org/plasticboy/vim-markdown)
+[](https://github.com/preservim/vim-markdown/actions?workflow=Vint)
+[](https://github.com/preservim/vim-markdown/actions?workflow=Vader)
Syntax highlighting, matching rules and mappings for [the original Markdown](http://daringfireball.net/projects/markdown/) and extensions.
```vim
Plugin 'godlygeek/tabular'
-Plugin 'plasticboy/vim-markdown'
+Plugin 'preservim/vim-markdown'
```
The `tabular` plugin must come *before* `vim-markdown`.
```sh
cd ~/.vim/bundle
-git clone https://github.com/plasticboy/vim-markdown.git
+git clone https://github.com/preservim/vim-markdown.git
```
To install without Pathogen using the Debian [vim-addon-manager](http://packages.qa.debian.org/v/vim-addon-manager.html), do this:
```sh
-git clone https://github.com/plasticboy/vim-markdown.git
+git clone https://github.com/preservim/vim-markdown.git
cd vim-markdown
sudo make install
vim-addon-manager install markdown
```
-If you are not using any package manager, download the [tarball](https://github.com/plasticboy/vim-markdown/archive/master.tar.gz) and do this:
+If you are using a package manager with semver support (like [lazy.nvim](https://github.com/folke/lazy.nvim)) make sure you are following the master branch (see https://github.com/preservim/vim-markdown/issues/616).
+
+If you are not using any package manager, download the [tarball](https://github.com/preservim/vim-markdown/archive/master.tar.gz) and do this:
```sh
cd ~/.vim
- `zR`: opens all folds
- `zm`: increases fold level throughout the buffer
- `zM`: folds everything all the way
-- `za`: open a fold your cursor is on
-- `zA`: open a fold your cursor is on recursively
+- `za`: toggle a fold your cursor is on
+- `zA`: toggle a fold your cursor is on recursively
+- `zo`: open a fold your cursor is on
+- `zO`: open a fold your cursor is on recursively
- `zc`: close a fold your cursor is on
- `zC`: close a fold your cursor is on recursively
Highlight TOML front matter as used by [Hugo](https://gohugo.io/content/front-matter/).
- TOML syntax highlight requires [vim-toml](https://github.com/cespare/vim-toml).
-
let g:vim_markdown_toml_frontmatter = 1
#### JSON Front Matter
Highlight JSON front matter as used by [Hugo](https://gohugo.io/content/front-matter/).
- JSON syntax highlight requires [vim-json](https://github.com/elzr/vim-json).
-
let g:vim_markdown_json_frontmatter = 1
#### Strikethrough
let g:vim_markdown_edit_url_in = 'tab'
+### Borderless tables
+
+- `g:vim_markdown_borderless_table`
+
+ Add support for borderless tables, such as:
+ ```
+ header 1|header 2
+ --|--
+ data 1|data 2
+ ```
+ if set to `1`:
+
+ let g:vim_markdown_borderless_table = 1
+
+ the table would be formatted as usual:
+ ```
+ | header 1 | header 2 |
+ |----------|----------|
+ | data 1 | data 2 |
+ ```
+
## Mappings
The following work on normal and visual modes:
Known limitation: does not work for links that span multiple lines.
-- `ge`: open the link under the cursor in Vim for editing. Useful for relative markdown links. `<Plug>Markdown_EditUrlUnderCursor`
+- `ge`: open the link under the cursor in Vim for editing. Useful for relative markdown links. Falls back to `gf` with force editing, if not on a markdown link. `<Plug>Markdown_EditUrlUnderCursor`
The rules for the cursor position are the same as the `gx` command.
- `]]`: go to next header. `<Plug>Markdown_MoveToNextHeader`
-- `[[`: go to previous header. Contrast with `]c`. `<Plug>Markdown_MoveToPreviousHeader`
+- `[[`: go to previous header. Contrast with `]h`. `<Plug>Markdown_MoveToPreviousHeader`
- `][`: go to next sibling header if any. `<Plug>Markdown_MoveToNextSiblingHeader`
- `[]`: go to previous sibling header if any. `<Plug>Markdown_MoveToPreviousSiblingHeader`
-- `]c`: go to Current header. `<Plug>Markdown_MoveToCurHeader`
+- `]h`: go to Current header. `<Plug>Markdown_MoveToCurHeader`
- `]u`: go to parent header (Up). `<Plug>Markdown_MoveToParentHeader`
- `:Tocv`: Same as `:Toc` for symmetry with `:Toch` and `:Tocv`.
+- `:InsertToc`: Insert table of contents at the current line.
+
+ An optional argument can be used to specify how many levels of headers to display in the table of content, e.g., to display up to and including `h3`, use `:InsertToc 3`.
+
+- `:InsertNToc`: Same as `:InsertToc`, but the format of `h2` headers in the table of contents is a numbered list, rather than a bulleted list.
+
## Credits
The main contributors of vim-markdown are:
-- **Ben Williams** (A.K.A. **plasticboy**). The original developer of vim-markdown. [Homepage](http://plasticboy.com/).
+- **Ben Williams** (A.K.A. **@plasticboy**). The original developer of vim-markdown. [Homepage](http://plasticboy.com/).
If you feel that your name should be on this list, please make a pull request listing your contributions.