Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A hackable markdown, Typst, latex, html(inline) & YAML previewer for Neovim

License

NotificationsYou must be signed in to change notification settings

OXY2DEV/markview.nvim

Repository files navigation

A hackableMarkdown,HTML,LaTeX,Typst &YAML previewer for Neovim.

:set wrap:set nowrap
wrapnowrap

✨ Features

Core features,

  • PreviewMarkdown,HTML,$LaTeX$,Typst &YAML within Neovim.
  • Hybrid editing mode! Allowingediting &previewing at the same time.
  • Splitview! Allows editing & previewingside-by-side.
  • Wrap support(markdown only, at the moment)! Allows using text wrapping while not losingmost rendering features!
  • Highly customisable! You can change almost anything using the config!
  • Dynamichighlight groups that automatically updates with the colorscheme!
  • Callout,checkbox completions forblink.cmp &nvim-cmp.

📚 Table of contents

Also see,

📜 Complete feature-list

Expand to see complete feature list

HTML,

  • Customizable previews forcontainer &void elements.

  • 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{}.
  • 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 forcallouts & 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
  • Wrap support for,

    • Block quotes & Callouts.
    • Sections(whenmarkdown.headings.org_indent is used).
    • List items(whenmarkdown.list_items.<item>.add_padding is true).
    • tables(limited due to technical limitations).
  • Org-mode like 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 modeLinewise hybrid mode
hybrid_modelinewise_hybrid_mode
  • Node-based edit range(default).Clears a range of lines covered by the (named)TSNode under 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 traceShow to see what the plugin has been doing(including how long some of them took).
  • You can also use:Markview traceExport to export these logs.

📚 Requirements

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$LaTeX$ parser.

  • markdown
  • markdown_inline
  • html(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.

📐 Installation

🧩 Vim-plug

Add this to your plugin list.

Plug'OXY2DEV/markview.nvim'

💤 Lazy.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" },},

🦠 Mini.deps

localMiniDeps=require("mini.deps");MiniDeps.add({source="OXY2DEV/markview.nvim",-- Completion for `blink.cmp`-- depends = { "saghen/blink.cmp" },});

🌒 Rocks.nvim

Warning

luarocks package may sometimes be a bit behindmain.

:Rocks install markview.nvim

📥 GitHub release

Tagged releases can be found in therelease page.

Note

Github releases may sometimes be slightly behindmain.

🪲 Known bugs

  • code spans don't get recognized when on the line after acode block(if the line after thecode span is empty).This is most likely due to some bug in either themarkdown or themarkdown_inline parser.

  • Incorrect wrapping when settingwrap usingmodeline.This is due totextoff being 0(instead of the size of thestatuscolumn) when entering a buffer.

🧭 Usage

You can find more usage recipeshere.

🎇 Commands

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-commandArgumentsDescription
TogglenoneToggles previewglobally.
EnablenoneEnables previewglobally.
DisablenoneDisables previewglobally.
togglebuffer, integerToggles preview forbuffer.
enablebuffer, integerEnables preview forbuffer.
disablebuffer, integerDisables preview forbuffer.
splitTogglenoneTogglessplitview.
Advanced commands are given belowSub-commands related to auto-registering new buffers for previews and/or manually attaching/detaching buffers,
Sub-commandArgumentsDescription
attachbuffer, integerAttaches tobuffer.
detachbuffer, integerDetaches frombuffer.
StartnoneAllows attaching to new buffers.
StopnonePrevents attaching to new buffers.

Sub-commands related to controllinghybrid_mode,

Sub-commandArgumentsDescription
HybridEnablenoneEnables hybrid mode.
HybridDisablenoneDisables hybrid mode.
HybridTogglenoneToggles hybrid mode.
hybridEnablebuffer, integerEnables hybrid mode forbuffer.
hybridDisablebuffer, integerDisables hybrid mode forbuffer.
hybridTogglebuffer, integerToggles hybrid mode forbuffer.
linewiseEnablenoneEnables linewise hybrid mode.
linewiseDisablenoneDisables linewise hybrid mode.
linewiseTogglenoneToggles linewise hybrid mode.

Sub-commands for working withsplitview,

Sub-commandArgumentsDescription
splitOpenbuffer, integerOpenssplitview forbuffer.
splitClosenoneCloses any opensplitview.
splitRedrawnoneUpdatessplitview contents.

Sub-commands for manualpreview updates,

Sub-commandArgumentsDescription
renderbuffer, integerRenders preview forbuffer.
clearbuffer, integerClears preview forbuffer.
RendernoneUpdates preview of allactive buffers.
ClearnoneClears preview of allactive buffer.

Sub-commands forbug report,

Sub-commandArgumentsDescription
traceExportnoneExports trace logs totrace.txt.
traceShownoneShows 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.

✅ Contributing to the projects

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 ofrequire("markview.renderers.markdown").output().
  • Optimization of the table renderer.
  • Stricter logic to reduce preview redraws.
  • Makesplitview update 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

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp