Fork of vim-markdown with extra functionality.
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
tab
in normal mode, they persist between sessions.[X]
in lists by pressing Control-c
in normal mode.backspace
while preserving indentation, or tab
to create a sub-list.[link text](url)
by pressing Control-k
in insert or visual mode. If pressed in an url, or in a word, it will autofill the correct field.
tab
can be used in insert mode to skip from one field to the next.Return
Return
will create a link to a markdown file, if pressed over a word.The following options control which syntax extensions will be turned on. They are off by default.
]]
: Go to next header. <Plug>Markdown_MoveToNextHeader
[[
: Go to previous header. Contrast with ]c
. <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
]u
: Go to parent header (Up). <Plug>Markdown_MoveToParentHeader
Ctrl-c
: Toggle checkboxes. <Plug>Markdown_Checkbox
Tab
: Fold headers/lists. <Plug>Markdown_Fold
Return
: Follow links. <Plug>Markdown_FollowLink
Tab
: Indent new bullets, jump through empty fields in links. <Plug>Markdown_Jump
Ctrl-k
: Create new links. <Plug>Markdown_CreateLink
O
: New line above, overrides default. <Plug>Markdown_NewLineAbove
o
: New line below, overrides default. <Plug>Markdown_NewLineBelow
Return
: New line below, overrides default. <Plug>Markdown_NewLineBelow
Ctrl-k
: Create new links. <Plug>Markdown_CreateLink
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
The following requires :filetype plugin on
.
:HeaderDecrease
: Decrease level of all headers in buffer: h2
to h1
, h3
to h2
, etc.
If range is given, only operate in the range.
If an h1
would be decreased, abort.
For simplicity of implementation, Setex headers are converted to Atx.
:HeaderIncrease
: Analogous to :HeaderDecrease
, but increase levels instead.
:SetexToAtx
: Convert all Setex style headers in buffer to Atx.
If a range is given, e.g. hit :
from visual mode, only operate on the range.
:Toc
: create a quickfix vertical window navigable table of contents with the headers.
Hit <Enter>
on a line to jump to the corresponding line of the markdown file.
:Toch
: Same as :Toc
but in a horizontal window.
:Tocv
: Same as :Toc
but in a vertical window.
: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.
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.
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.