ixru / nvim-markdown

Markdown Vim Mode
http://plasticboy.com/markdown-vim-mode/
87 stars 11 forks source link

Nvim Markdown

Fork of vim-markdown with extra functionality.

Installation

This plugin requires Neovim 0.5+

Use a package manager like vim-plug to install it.

To install with vim-plug add: Plug 'ixru/nvim-markdown'

To install manually instead, see :help plugin

Features

Options

Syntax Concealing Concealing is set for some syntax. For example, conceal `[link text](link url)` as just `link text`. Also, `_italic_` and `*italic*` will conceal to just _italic_. Similarly `__bold__`, `**bold**`, `___italic bold___`, and `***italic bold***` will conceal to just __bold__, **bold**, ___italic bold___, and ***italic bold*** respectively. To change what is concealed use one of these in your vimrc: let g:vim_markdown_conceal = 0 " Nothing is concealed let g:vim_markdown_conceal = 1 " Links are concealed let g:vim_markdown_conceal = 2 " Links and text formatting is concealed (default) To disable math conceal with LaTeX math syntax enabled, add the following to your `.vimrc`: let g:tex_conceal = "" let g:vim_markdown_math = 1
Enable TOC window auto-fit Allow for the TOC window to auto-fit when it's possible for it to shrink. It never increases its default size (half screen), it only shrinks. let g:vim_markdown_toc_autofit = 1
Text emphasis restriction to single-lines By default text emphasis works across multiple lines until a closing token is found. However, it's possible to restrict text emphasis to a single line (i.e., for it to be applied a closing token must be found on the same line). To do so: let g:vim_markdown_emphasis_multiline = 0
Fenced code block languages You can use filetype name as fenced code block languages for syntax highlighting. If you want to use different name from filetype, you can add it in your `.vimrc` like so: let g:vim_markdown_fenced_languages = ['csharp=cs'] This will cause the following to be highlighted using the `cs` filetype syntax. ```csharp ... ``` Default is `['c++=cpp', 'viml=vim', 'bash=sh', 'ini=dosini']`.

Syntax extensions

The following options control which syntax extensions will be turned on. They are off by default.

LaTeX math Used as `$x^2$`, `$$x^2$$`, escapable as `\$x\$` and `\$\$x\$\$`. let g:vim_markdown_math = 1
YAML Front Matter Highlight YAML front matter as used by Jekyll or [Hugo](https://gohugo.io/content/front-matter/). let g:vim_markdown_frontmatter = 1
TOML Front Matter 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

Mappings

Normal mode

This plugin follows the recommended Vim plugin mapping interface, so to change the map ]u to asdf, add to your .vimrc:

map asdf <Plug>Markdown_MoveToParentHeader

To disable a map use:

map <Plug> <Plug>Markdown_MoveToParentHeader

To disable all mappings use:

let g:vim_markdown_no_default_key_mappings = 1

Commands

The following requires :filetype plugin on.

Credits

The main contributors of vim-markdown are:

If you feel that your name should be on this list, please make a pull request listing your contributions.

License

The MIT License (MIT)

Copyright (c) 2012 Benjamin D. Williams

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.