Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

roerohan/mark.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

mark.nvim

A beautiful terminal-based markdown preview for Neovim with live rendering, syntax highlighting, and no browser required.

screenshot

โœจ Features

  • ๐ŸŽจ Beautiful Themes - GitHub Dark, Monokai, Nord, Orng (cycle with T)
  • ๐Ÿ“Š Full Markdown Support - Tables, inline formatting, code blocks
  • ๐ŸŽฏ Live Preview - Auto-updates as you type
  • ๐Ÿ”ค Syntax Highlighting - Tree-sitter powered code blocks
  • ๐Ÿ‘€ Conceal Mode - Hide formatting markers (toggle with C)
  • ๐Ÿš€ Streaming Demo - Watch content appear in real-time
  • ๐Ÿ’ป Terminal Native - No browser, works in tmux/ssh

๐Ÿ“ฆ Requirements

  • Neovim >= 0.9.0
  • Bun >= 1.0.0

๐Ÿš€ Installation

{
  'roerohan/mark.nvim',
  ft = 'markdown',
  build = 'cd typescript && bun install && bun run build',
  config = function()
    require('mark').setup()
  end,
}
use {
  'roerohan/mark.nvim',
  ft = 'markdown',
  run = 'cd typescript && bun install && bun run build',
  config = function()
    require('mark').setup()
  end,
}

๐ŸŽฎ Usage

Commands

:MarkPreview        " Start preview
:MarkPreviewStop    " Stop preview
:MarkPreviewToggle  " Toggle preview

Keybindings in Preview

Key Action
T Cycle themes (GitHub โ†’ Monokai โ†’ Nord โ†’ Orng)
C Toggle conceal mode
R Reload file
S Start streaming demo
E Toggle endless streaming
X Stop streaming
[ / ] Adjust streaming speed
? Show help
ESC Exit preview

In Neovim

<leader>mp    " Toggle preview (default mapping)
<C-w>w        " Switch between editor and preview

โš™๏ธ Configuration

require('mark').setup({
  split_position = 'right',  -- 'right', 'left', 'top', 'bottom'
  split_size = 50,           -- Percentage (1-100)
  auto_start = false,        -- Auto-start on markdown files
  theme = 'GitHub Dark',     -- 'GitHub Dark', 'Monokai', 'Nord', 'Orng'
  
  mappings = {
    toggle_preview = '<leader>mp',
  },
})

Theme Options

Set your preferred default theme:

require('mark').setup({
  theme = 'Orng',  -- Start with orng theme
})

Available themes:

  • 'GitHub Dark' - Clean and familiar (default)
  • 'Monokai' - Classic and vibrant
  • 'Nord' - Beautiful Nordic palette
  • 'Orng' - Warm orange accents

You can still cycle themes in the preview with the T key!

๐Ÿงช Quick Test

# Navigate to plugin directory
cd ~/.local/share/nvim/lazy/mark.nvim  # or your plugin path

# Open test file
nvim tests/demo.md

# In Neovim
:MarkPreview

Then try:

  • Press T to cycle through themes
  • Press C to toggle conceal mode
  • Press ? for help
  • Edit the file and watch it update live

๐Ÿ“š Supported Markdown

โœ… Headings (H1-H6) with colors
โœ… Bold, italic, inline code
โœ… Tables with automatic alignment
โœ… Code blocks with syntax highlighting
โœ… Lists (ordered and unordered)
โœ… Blockquotes
โœ… Horizontal rules
โœ… Links
โœ… Unicode and emoji ๐ŸŽ‰

๐Ÿ”ง Troubleshooting

Preview not showing?

:lua require('mark.commands').debug_info()

Check build:

ls typescript/dist/main.js  # Should exist
cd typescript && bun run build  # Rebuild if needed

Old preview showing?

" Reload plugin
:lua package.loaded['mark.commands'] = nil
:lua require('mark').setup()

๐Ÿ—๏ธ Architecture

Neovim (Lua)  โ†โ†’  Terminal  โ†โ†’  OpenTUI App (TypeScript)
  โ”‚                                      โ”‚
  โ”œโ”€ Commands                           โ”œโ”€ MarkdownRenderable
  โ”œโ”€ Window management                  โ”œโ”€ 4 Themes
  โ””โ”€ Auto-save                          โ”œโ”€ File watching
                                        โ””โ”€ Keyboard handling

๐ŸŽจ Themes Preview

GitHub Dark - Clean and familiar
Monokai - Classic and vibrant
Nord - Beautiful Nordic palette
Orng - Warm orange accents with excellent contrast

Switch between them instantly with T key!

๐Ÿ“ Development

cd typescript

# Build
npm run build

# Watch mode
npm run dev

# Test
./test.sh

๐Ÿค Contributing

Contributions welcome! Please:

  1. Fork the repo
  2. Create a feature branch
  3. Submit a PR

๐Ÿ“„ License

MIT License

๐Ÿ™ Acknowledgments

Built with:

  • OpenTUI - Terminal UI framework with built-in markdown rendering
  • Bun - Fast JavaScript runtime

About

A beautiful terminal-based markdown preview for Neovim with live rendering, syntax highlighting, etc.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors