sponsor Vim development Vim logo Vim Book Ad

mkdx.vim : Adds useful mappings for working with markdown files

 script karma  Rating 113/48, Downloaded by 9035  Comments, bugs, improvements  Vim wiki

created by
Sidney Liebrand
script type
This is a mirror of https://github.com/SidOfc/mkdx. The version there will always be up-to-date.

mkdx.vim is a markdown plugin that aims to reduce the time you spend formatting your markdown documents. It does this by adding some configurable mappings for files with a markdown filetype. Functions are included to handle lists, checkboxes (even lists of checkboxes!), fenced code blocks, shortcuts, headers and links. In addition to that, this plugin provides a mapping to convert a selection of CSV data to a markdown table. and well, lots more even! Visit :h mkdx or :h mkdx-helptags for more information.
install details
Plugin installation is possible using a package manager like Vundle (https://github.com/VundleVim/Vundle.vim) or Pathogen (https://github.com/tpope/vim-pathogen).
If you're downloading the ZIP, I'm just going to assume you know what you're doing and that it is exactly what you want to do, 21st century installation is always an option to fall back to :)
IMPORTANT: Github is updated more frequently, therefore I highly recommend using a package manager instead of doing a manual install, you could be missing some patches otherwise.

rate this script Life Changing Helpful Unfulfilling 
script versions (upload new version)

Click on the package to download.

package script version date Vim version user release notes
mkdx-1.10.0.zip 1.10.0 2020-09-11 8.0 Sidney Liebrand - Add: mkdx#gf_visual function which mimicks mkdx#gf using visually selected text (#119)
- Add: opt-in support for TOML and JSON frontmatter and settings to control which syntax is supported.
- Add: feature to renumber numbered list items with tab/shift+tab (#113)
- Fix: eager-load settings to ensure settings are properly initialized before loading a markdown file (#125 by @victorkristof)
- Fix: using mkdx#gf with multiple lines with a link always opening first link (#122 by @Delayless)
- Fix: non plaintext files now also open using open instead of in (n)vim (#116 by @kraxli)
- Fix: links with subdomains failed to open using mkdx#gf (#116 by @kraxli)
- Fix: issue when setting let g:markdown_folding = 1 causing Pattern not found: g:mkdx#settings.fold.enable = 0
- Fix: use maparg to check exact mappings exist instead of mapcheck (#112 by @Mayrixon)
- Fix: issue in neovim reporting external links as broken due to unbuffered stdout
- Fix: add missing highlight groups to clear when toggling highlighting on/off by updating the setting
mkdx-1.9.4.zip 1.9.4 2020-05-23 8.0 Sidney Liebrand -  Add: when conceallevel is set, markdown link urls are now also hidden (#108 by @Ginner)
-  Fix: improved cursor position after unwrapping text
mkdx-1.9.3.zip 1.9.3 2020-05-21 8.0 Sidney Liebrand -  Add: ability to press enter in the middle of a list-item to split it into two (#107 by @samarulmeu)
-  Fix: wrapping last word shifting word to right in some cases (#101 by @samarulmeu
mkdx-1.9.2.zip 1.9.2 2020-05-18 8.0 Sidney Liebrand -  Add: text wrap mappings can now be prefixed with a count tada (#103 by @victorkristof)
-  Add: ability to toggle bold / italic / strikethrough / inline-code / link wrapping (#101 by @victorkristof)
-  Add: enhanced versions of gf and gx and g:mkdx#settings.gf_on_steroids (#100 by @victorkristof and @samarulmeu)
-  Add: support YAML frontmatter
-  Add: ability to create multi-paragraph quotes
-  Add: toggling a quote with a multi-line selection no longer skips empty lines (#94 by @samarulmeu)
-  Add: toggling code will now toggle a code-block instead when in Visual-linewise mode (#93)
-  Add: CriticMarkup highlighting
-  Fix: no-op folding functions when g:markdown_folding is enabled
-  Fix: allow mkdx to work with plasticboy/vim-markdown enabled
-  Fix: insertion of double quote marks on enter
-  Fix: removed duplicate helptag causing Vundle to crash
-  Fix: <details /> TOC not unindenting properly when &sw is 0
-  Fix: typo in README (#88 by @Ginner)
mkdx-1.9.1.zip 1.9.1 2019-05-11 7.0 Sidney Liebrand - Fix: Handle non-ascii characters in header (TOC) links (https://github.com/SidOfc/mkdx/pull/85 by @totpet)
mkdx-1.9.0.zip 1.9.0 2018-11-23 7.0 Sidney Liebrand - Add: Table of contents supports configurable nested details tags
- Add: g:mkdx#settings.toc.details.nesting_level to control nested details generation
- Add: g:mkdx#settings.toc.details.child_count to control after how many children a nested details tag will appear
- Add: g:mkdx#settings.toc.details.child_summary to control summary text inside nested details
mkdx-1.8.3.zip 1.8.3 2018-11-21 7.0 Sidney Liebrand - Fix: handle unicode characters in list items (#80 - https://github.com/SidOfc/mkdx/issues/80)
- Fix: handle unicode characters in CSV (#81 - https://github.com/SidOfc/mkdx/issues/81)
mkdx-1.8.2.zip 1.8.2 2018-11-14 7.0 Sidney Liebrand - Fix: handle &shiftwidth = 0 (Thanks to @marcdeop -- https://github.com/marcdeop).
mkdx-1.8.1.zip 1.8.1 2018-09-09 7.0 Sidney Liebrand - Add: Mkdx can convert tables back to CSV
- Fix: Only open quickfix when broken links are present(#56)
- Fix: Table highlighting now stops at the end of a table (#57)
- Fix: Empty cells in CSV also get a border (#61)
- Fix: All hasmapto calls are mode specific (#64)
- Fix: g:mkdx#settings.restore_visual can now be disabled during runtime (#65)
- Fix: Wrapping at end of line no longer breaks when line ends with non word characters (#67)
- Fix: No longer pollute register when updating table of contents (#68)
- Fix: Empty setex-style headers are no longer added to quickfix headers or the table of contents (#69)
- Fix: Always empty quickfix list before showing dead links (#70)
mkdx-1.8.0.zip 1.8.0 2018-08-03 7.0 Sidney Liebrand - Add: Setting to control updating TOC before writing the buffer (https://github.com/SidOfc/mkdx/pull/54)
- Fix: Unable to position TOC as last header (https://github.com/SidOfc/mkdx/pull/53)
mkdx-1.7.1.zip 1.7.1 2018-07-31 7.0 Sidney Liebrand - Add: Pressing <enter> after an inline list item creates a new list item instead of a blank line.
mkdx-1.7.0.zip 1.7.0 2018-06-24 7.0 Sidney Liebrand Add: Support Setex style headings (- / = characters below nonblank line)
Add: Support Setex style headings in completion menu
Add: Support Setex style headings in TOC generation
- Add: Support Setex style headings in header listing
- Add: Setting to allow customizing strikethrough style (#49)
- Fix: TOC without any nested elements created too many closing tags when generated using <details> tag
- Fix: Non-list items sometimes got detected as list items when starting with a number on shift+O
- Fix: overriding g:mkdx#settings with has('*dictwatcheradd') crashing Vim
mkdx-1.6.1.zip 1.6.1 2018-05-14 7.0 Sidney Liebrand Add: Highlighting for tables, <kbd> shortcuts and _**bolditalic**_.
Add: shift+enter support to create multiline items (#44).
Fix: shift+enter no longer require double escape to exit insert mode.
Fix: Dead link detection, incorrect external label and relative links were always skipped.
Fix: grep and ggrep do not count line column properly (byte-offset is converted now).
mkdx-1.6.0.zip 1.6.0 2018-05-11 7.0 Sidney Liebrand
Fix: Handle URLS starting with "../../" correctly.
- Fix: Removed hardcoded hashtag as header identifier in function.
- Fix: (#35) Generating a TOC in the details didn't generate the final closing tags.
- Fix: (#40) Shift-o (O) prepending a list item to a line starting with a number.
- Fix: (#39) Set autoindent, it is enabled by default in Neovim but disabled by default in Vim.
- Add: (#41) Fold support for the table of contents and fenced code blocks (opt-in).
- Add setting to enable folding: g:mkdx#settings.fold.enable = 0.
- Add setting to modify what is folded: g:mkdx#settings.fold.components = ['toc', 'fence'].
    - Add: (#32) dictionarywatcher that watches settings and immediately updates the document.
    - Add: setting to control auto-updates: g:mkdx#settings.auto_update.enable = 1.
mkdx-1.5.1.zip 1.5.1 2018-05-05 7.0 Sidney Liebrand - dead link detection (https://github.com/sidofc/mkdx#dead-link-detection) uses a grep program and job when available
- jumping to headers (https://github.com/sidofc/mkdx#jump-to-header) uses a grep program and job when available
- insert autocompletion (https://github.com/sidofc/mkdx#insert-mode-fragment-completion) uses a grep program and job when available
mkdx-1.5.0.zip 1.5.0 2018-04-28 7.0 Sidney Liebrand Add insert mode completion for fragment links (https://github.com/SidOfc/mkdx#insert-mode-fragment-completion).
- Add setting (https://github.com/SidOfc/mkdx#gmkdxsettingslinksfragmentcomplete) to control completions.
- Add support for anchor fragment links (#24 (https://github.com/SidOfc/mkdx/issues/24)) (<a id="hello"></a> / <a name="hello"></a>) for jumping (https://github.com/SidOfc/mkdx#jump-to-header), detection (https://github.com/SidOfc/mkdx#dead-link-detection) and completion (https://github.com/SidOfc/mkdx#insert-mode-fragment-completion).
- Fix issue where double slashes in the URL would not be removed in external link checks.
- Fix nested <a></a> tags in generated TOC links.
mkdx-1.4.3.zip 1.4.3 2018-04-27 7.0 Sidney Liebrand (#17 - https://github.com/SidOfc/mkdx/issues/17) Add a mapping to go to fragment link location. (https://github.com/sidofc/mkdx#jump-to-header)
(#18 - https://github.com/SidOfc/mkdx/issues/18) Add alignment options for columns in a table generated from CSV. (https://github.com/sidofc/mkdx#gmkdxsettingstablealign)
(#18 - https://github.com/SidOfc/mkdx/issues/18) Add alignment options for specific column names or indexes in a table generated from CSV. (https://github.com/sidofc/mkdx#gmkdxsettingstablealign)
List items require a space after them to be recognized as a list item.
mkdx-1.4.2.zip 1.4.2 2018-04-15 7.0 Sidney Liebrand - Convert CSV to table (https://github.com/SidOfc/mkdx#convert-csv-to-table) now also supports quoted CSV and TSV data
mkdx-1.4.1.zip 1.4.1 2018-04-08 7.0 Sidney Liebrand - Dead link detection will now also scan any `href=""` attribute content.
mkdx-1.4.0.zip 1.4.0 2018-04-08 7.0 Sidney Liebrand - Update Dead link detection (https://github.com/SidOfc/mkdx#dead-link-detection) to include support for external and relative links.
- Add new settings (https://github.com/SidOfc/mkdx#gmkdxsettingslinksexternalenable) to control request timeout and relative link host etc.
mkdx-1.3.0.zip 1.3.0 2018-04-02 7.0 Sidney Liebrand - Added feature: Dead fragment link detection
- Automatically remove "r" from "formatoptions" inside markdown files (buffer local override)
- Fix table of contents eating a header when there is no blank line between the table of contents and the next heading
- Cursor stays on the same line after updating table of contents
- mkdx#QuickfixHeaders() shows amount of headers and doesn't open quickfix when no headers are present.
mkdx-1.2.0.zip 1.2.0 2018-04-01 7.0 Sidney Liebrand Added feature: Support generating table of contents inside <details> tag. (https://github.com/sidofc/mkdx#generate-or-update-toc-as-details)
mkdx-1.1.0.zip 1.1.0 2018-03-31 7.0 Sidney Liebrand - Stricter rules for highlighting (do not highlight bold markers at start of line as list items).
- Fix TOC links using headings containing <kbd /> tags.
- Fix deep merging of `g:mkdx#settings` hash.
- Add setting to place TOC in fixed position.
mkdx-1.0.2.zip 1.0.2 2018-03-25 7.0 Sidney Liebrand - Fix incorrect mapping detection
- Update README, add remapping section
mkdx-1.0.1.zip 1.0.1 2018-03-24 7.0 Sidney Liebrand - All mappings now use <Plug>(mkdx-*) structure
mkdx-1.0.0.zip 1.0.0 2018-03-24 7.0 Sidney Liebrand - Fix #11 - `mkdx#ToggleQuote` inserting `0` on empty lines
- Fix #12 - Update (task-)lists inside a quote
- Fix #13 - Add / remove (task-)lists inside a quote
- Add `<Plug>(mkdx-o)` in favor of directly mapping to `A<Cr>` to trigger `mkdx#EnterHandler`
- Add `<Plug>(mkdx-shift-o)` in favor of directly mapping to `:call mkdx#ShiftOHandler()<Cr>`
mkdx-0.9.0.zip 0.9.0 2018-01-28 7.0 Sidney Liebrand - Fix `mkdx#HeaderToQF` wrong function ref.
- Fix `g:mkdx#settings.enter.enable` and `g:mkdx#settings.enter.shifto` can be disabled during runtime.
- Fix insert mode "\~\~\~" and "\`\`\`" recursion.
- Add support for [toggling \<kbd /> shortcuts](#toggling-kbd--shortcuts) in normal and visual mode.
mkdx-0.8.0.zip 0.8.0 2018-01-21 7.0 Sidney Liebrand - Fix some issues with `mkdx#WrapLink`.
- `mkdx#WrapLink` handles selections that include newline character correctly.
- Headers can now also be toggled on / off using `mkdx#ToggleHeader`.
- When deleting a list item anywhere in the list, following list items are decremented by 1.
- Added more tests for
    - decrementing list items
    - promoting / demoting headers
    - Wrapping links and images
mkdx-0.7.1.zip 0.7.1 2018-01-13 7.0 Sidney Liebrand Adds shift-o support alongside regular o and enter in insert mode. when pressing shift-o in the middle of a list, an item will be inserted above the current line and the cursor will be moved there.
mkdx-0.7.0.zip 0.7.0 2018-01-13 7.0 Sidney Liebrand Adds menu support if it is available to the installed vim. menu will be displayed in the top bar in gvim/macvim and can be accessed through :menu Plugin.mkdx from terminal vims that support it.
mkdx-0.6.1.zip 0.6.1 2018-01-10 7.0 Sidney Liebrand Fixes space prepended when wrapping the only word on a line in a link
mkdx-0.6.0.zip 0.6.0 2018-01-07 7.0 Sidney Liebrand Adds opt-in highlighting for different checkbox states. See GH README for gifs. or :h mkdx-highlighting within Vim for more information.
mkdx-0.5.0.zip 0.5.0 2018-01-06 7.0 Sidney Liebrand Added feature to open the quickfix list containing all markdown headers in the current file.
mkdx- 2018-01-05 7.0 Sidney Liebrand HOTFIX: EnterHandler not inserting enters in some cases (prepends a "0" to the current line instead)
mkdx-0.4.3.zip 0.4.3 2018-01-01 7.0 Sidney Liebrand Complete rewrite of mkdx#EnterHandler.
Task lists are updated when an item is removed (pressing enter twice at the end of an existing list item).
Better updating / inserting of regular lines of checkboxes.
Happy new year too, everyone :)
mkdx-0.4.2.zip 0.4.2 2017-12-31 7.0 Sidney Liebrand Fixes issue where enter would be offset by 1 character horizontally.
In addition to completing list items, quotes and checklist items, pressing enter after a checkbox task will now add a checkbox on the new line as well :)
Major settings refactor that maintains backward compatibility. See :h mkdx-var-settings for more information.
mkdx-0.4.1.zip 0.4.1 2017-12-30 7.0 Sidney Liebrand Adds better support for toggling from and to specific types of lines such as checkboxes, checklists and lists.
RENAMED: mkdx#ToggleCheckbox to mkdx#ToggleCheckboxState.
mkdx-0.4.0.zip 0.4.0 2017-12-24 7.0 Sidney Liebrand This version adds support for toggling between regular lines and list/checkbox/checklist lines.
It also fixes an issue where pressing ENTER at the start of a line would actually execute ENTER after the first character (thus leaving a character "hanging").
When updating the table of contents, the cursor position is correctly restored to its original position.
mkdx-0.3.0.zip 0.3.0 2017-12-18 7.0 Sidney Liebrand Add support for wrapping text in bold, italic, strikethrough and inline-code in normal and visual mode.
Fixes a bug where wrapping link at end of line would not respect spacing.
mkdx-0.2.0.zip 0.2.0 2017-12-08 7.0 Sidney Liebrand Add support for wrapping images in image links and pressing <Enter> in a tasklist now updates the tasklist after adding a new empty task.
mkdx-0.1.8.zip 0.1.8 2017-12-06 7.0 Sidney Liebrand This version provides better support for malformed indentation when updating checkboxes in nested lists.
mkdx-0.1.7.zip 0.1.7 2017-12-03 7.0 Sidney Liebrand This version adds support for updating parent and child checklist items in markdown lists.
mkdx-0.0.7.zip 0.0.7 2017-11-25 7.0 Sidney Liebrand This version adds support for checkboxes in list items. When a checkbox is detected on the line where <enter> was pressed, an empty checkbox will be inserted in the new empty line.
mkdx-0.0.6.zip 0.0.6 2017-11-25 7.0 Sidney Liebrand Initial upload
ip used for rating:

If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to the maillist. Help Bram help Uganda.