- Notifications
You must be signed in to change notification settings - Fork70
A hackable markdown, Typst, latex, html(inline) & YAML previewer for Neovim
License
OXY2DEV/markview.nvim
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
A hackableMarkdown,HTML,LaTeX,Typst &YAML previewer for Neovim.
:set wrap | :set nowrap |
|---|---|
![]() | ![]() |
Core features,
- Preview
Markdown,HTML,$LaTeX$ ,Typst&YAMLwithin Neovim. - Hybrid editing mode! Allowingediting &previewing at the same time.
- Splitview! Allows editing & previewingside-by-side.
Wrapsupport(markdown only, at the moment)! Allows using text wrapping while not losingmost rendering features!- Highly customisable! You can change almost anything using the config!
- Dynamic
highlight groupsthat automatically updates with the colorscheme! Callout,checkboxcompletions forblink.cmp&nvim-cmp.
Also see,
Expand to see complete feature list
HTML,

Customizable previews for
container&voidelements.Supports the following container elements out of the box,
<a></a><b></b><code></code><em></em><i></i><kbd></kbd><mark></mark><pre></pre><s></s>,<strike></strike>,<del></del><strong></strong><sub></sub><sup></sup><u></u>
Supports the following void elements out of the box,
<hr><br>
LaTeX,

Supports basic LaTeX syntax,
- Math blocks(typically
$$...$$) & inline math(typically$...$). - Escaped characters.
- Math fonts
- Math symbols.
\text{}.
- Math blocks(typically
Supports commonly used math commands out of the box,
\frac{}\sin{}\cos{}\tan{}\sinh{}\cosh{}\tanh{}\csc{}\sec{}\cot{}\csch{}\sech{}\coth{}\arcsin{}\arccos{}\arctan{}\arg{}\deg{}\drt{}\dim{}\exp{}\gcd{}\hom{}\inf{}\ker{}\lg{}\lim{}\liminf{}\limsup{}\ln{}\log{}\min{}\max{}\Pr{}\sup{}\sqrt{}\lvert{}\lVert{}\boxed{}
Supports the following math fonts(requires anymodern Unicode font),
default(Default math font).\mathbb{}\mathbf{}\mathbffrak{}\mathbfit{}\nathbfscr{}\mathcal{}\mathfrak{}\mathsf{}\mathsfbf{}\mathsfbfit{}\mathsfit{}\mathtt{}
Supports Unicode basedsubscript &superscript texts.
Supports2056 different math symbol definitions.
Markdown,

Supports basic markdown(Github-flavored) syntax,
- Block quotes(with support for
callouts& titles). - Fenced code blocks.
- Headings(
setext&atx). - Horizontal rules.
- List items(
+,-,*,n.&n)). - Minus & plus metadata.
- Reference link definitions.
- Tables.
- Checkboxes(supportsminimal-style checkboxes).
- Email links.
- Entity references.
- Escaped characters.
- Footnotes.
- Hyperlinks.
- Images.
- Inline codes/Code spans.
- Autolinks
- Block quotes(with support for
Wrapsupport for,- Block quotes & Callouts.
- Sections(when
markdown.headings.org_indentis used). - List items(when
markdown.list_items.<item>.add_paddingis true). tables(limited due to technical limitations).
Org-modelike indentation for headings.

Obsidian/PKM extended syntax support,
- Block reference links.
- Embed file links.
- Internal links(supportsaliases).
Wide variety of HTML entity names & codes support.
- Supported named entities:786.
- Supported entity codes
Github emoji shorthands support. Supports1920 shorthands.
Custom configuration based on link patterns.
Typst,

Supports the following items,
- Code blocks.
- Code spans.
- Escaped characters.
- Headings.
- Labels.
- List items(
-,+&n.). - Math blocks.
- Math spans.
- Raw blocks.
- Raw spans.
- Reference links.
- Subscripts.
- Superscripts.
- Symbols.
- Terms.
- URL links.
Supports a variety of typst symbols,
- Symbol entries:932
- Symbol shorthands:40
Supports Unicode basedsubscript &superscript texts.
YAML,

Custom property icons.
Custom property scope decorations.
Custom icons(/decorations) based on property type & value(e.g.
booleans).Supports the following properties out of the box,
- tags.
- aliases.
- cssclasses.
- publish.
- permalink.
- description.
- images.
- cover.
Hybrid mode
| Normal hybrid mode | Linewise hybrid mode |
|---|---|
![]() | ![]() |
Node-based edit range(default).Clears a range of lines covered by the (named)
TSNodeunder the cursor. Useful when editing lists, block quotes, code blocks, tables etc.Range-based edit range.Clears the selected number of lines above & below the cursor.
Supports multi-window setups.
Splitview
- View previews in a separate window.
- Scroll sync between raw file & preview window.
Others
Internal Icon provider features,
- 708 different filetype configuration.
- Dynamic highlight groups for matching the colorscheme.

- You can use
:Markview traceShowto see what the plugin has been doing(including how long some of them took). - You can also use
:Markview traceExportto export these logs.
System,
- Neovim: >= 0.10.3
Note
It is recommended to usenowrap(though there is wrap support in the plugin) &expandtab.
Colorscheme,
- Anytree-sitter based colorscheme is recommended.
External icon providers,
Note
You need to change the config to use the desired icon provider.
{preview= {icon_provider="internal",-- "mini" or "devicons" }}Parsers,
Tip
You can usenvim-treesitter to easily install parsers. You can install all the parsers with the following command,
:TSInstall markdown markdown_inline html latex typst yaml
Important
On windows, you might needtree-sitter CLI for the
markdownmarkdown_inlinehtml(optional)latex(optional)typst(optional)yaml(optional)
Fonts,
- Anymodern Unicode font is required for math symbols.
- Nerd fonts are recommended.
Tip
It is recommended to run:checkhealth markview after installing the plugin to check if any potential issues exist.
Add this to your plugin list.
Plug'OXY2DEV/markview.nvim'Warning
Donot lazy load this plugin as it is already lazy-loaded. Lazy-loading may causemore time for the previews to load when starting Neovim!
The plugin should be loadedafter your colorscheme to ensure the correct highlight groups are used.
-- For `plugins/markview.lua` users.return {"OXY2DEV/markview.nvim",lazy=false,-- Completion for `blink.cmp`-- dependencies = { "saghen/blink.cmp" },};
-- For `plugins.lua` users.{"OXY2DEV/markview.nvim",lazy=false,-- Completion for `blink.cmp`-- dependencies = { "saghen/blink.cmp" },},
localMiniDeps=require("mini.deps");MiniDeps.add({source="OXY2DEV/markview.nvim",-- Completion for `blink.cmp`-- depends = { "saghen/blink.cmp" },});
Warning
luarocks package may sometimes be a bit behindmain.
:Rocks install markview.nvim
Tagged releases can be found in therelease page.
Note
Github releases may sometimes be slightly behindmain.
code spans don't get recognized when on the line after acode block(if the line after thecode spanis empty).This is most likely due to some bug in either themarkdownor themarkdown_inlineparser.Incorrect wrapping when setting
wrapusingmodeline.This is due totextoffbeing 0(instead of the size of thestatuscolumn) when entering a buffer.
You can find more usage recipeshere.
This plugin follows thesub-commands approach for creating commands. There is only a single:Markview command.
It comes with the following sub-commands,
Note
When no sub-command name is provided(or an invalid sub-command is used):Markview will run:Markview Toggle.
| Sub-command | Arguments | Description |
|---|---|---|
Toggle | none | Toggles previewglobally. |
Enable | none | Enables previewglobally. |
Disable | none | Disables previewglobally. |
toggle | buffer, integer | Toggles preview forbuffer. |
enable | buffer, integer | Enables preview forbuffer. |
disable | buffer, integer | Disables preview forbuffer. |
splitToggle | none | Togglessplitview. |
Advanced commands are given below
Sub-commands related to auto-registering new buffers for previews and/or manually attaching/detaching buffers,| Sub-command | Arguments | Description |
|---|---|---|
attach | buffer, integer | Attaches tobuffer. |
detach | buffer, integer | Detaches frombuffer. |
Start | none | Allows attaching to new buffers. |
Stop | none | Prevents attaching to new buffers. |
Sub-commands related to controllinghybrid_mode,
| Sub-command | Arguments | Description |
|---|---|---|
HybridEnable | none | Enables hybrid mode. |
HybridDisable | none | Disables hybrid mode. |
HybridToggle | none | Toggles hybrid mode. |
hybridEnable | buffer, integer | Enables hybrid mode forbuffer. |
hybridDisable | buffer, integer | Disables hybrid mode forbuffer. |
hybridToggle | buffer, integer | Toggles hybrid mode forbuffer. |
linewiseEnable | none | Enables linewise hybrid mode. |
linewiseDisable | none | Disables linewise hybrid mode. |
linewiseToggle | none | Toggles linewise hybrid mode. |
Sub-commands for working withsplitview,
| Sub-command | Arguments | Description |
|---|---|---|
splitOpen | buffer, integer | Openssplitview forbuffer. |
splitClose | none | Closes any opensplitview. |
splitRedraw | none | Updatessplitview contents. |
Sub-commands for manualpreview updates,
| Sub-command | Arguments | Description |
|---|---|---|
render | buffer, integer | Renders preview forbuffer. |
clear | buffer, integer | Clears preview forbuffer. |
Render | none | Updates preview of allactive buffers. |
Clear | none | Clears preview of allactive buffer. |
Sub-commands forbug report,
| Sub-command | Arguments | Description |
|---|---|---|
traceExport | none | Exports trace logs totrace.txt. |
traceShow | none | Shows trace logs in a window. |
Tip
buffer defaults to the current buffer. So, you can run commands on the current buffer without providing the buffer.
:Markview toggle"Toggles preview of the current buffer.If you have time and want to make this project better, consider helping me fix any of these issues,
- Add support for more filetypes in the internal icon provider.
- Optimization of
require("markview.renderers.markdown").output(). - Optimization of the table renderer.
- Stricter logic to reduce preview redraws.
- Make
splitviewupdate as little content as possible. - Make the help files/wiki more beginner friendly.
About
A hackable markdown, Typst, latex, html(inline) & YAML previewer for Neovim
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.






