MIT License

项目介绍

toppair/peek.nvim 是一个托管在 GitHub 上的开源项目,主要使用 TypeScript 编写,采用 MIT License 许可证,目前获得 871 个 Star、84 次 Fork。

仓库全名
toppair/peek.nvim
开源许可证
MIT License
Star 数
871
Fork 数
84
未关闭 Issue
37

README 摘要

peek.nvim Markdown preview plugin for Neovim :sparkles: Features live update synchronized scrolling github-style look TeX math Mermaid diagrams :battery: Requirements Deno :electricplug: Installation lazy.nvim :wrench: Configuration :paperclip: app option Preview opens in a webview window by default. You can set this option to 'browser' (will use your default browser as previewer) or specify browser along with…

完整内容见 GitHub 原始 README 或本页 。

常见问题

peek.nvim 用什么语言开发?

主要使用 TypeScript 编写,采用 MIT License 许可证,目前有 871 个 Star。

peek.nvim 可以免费商用吗?

仓库采用 MIT License 许可证,可免费使用与修改,商业使用请遵守许可证条款(例如保留版权声明与许可声明)。

如何获取 peek.nvim 的源码?

可以直接克隆仓库:git clone https://github.com/toppair/peek.nvim.git;安装与运行步骤见仓库 README。

peek.nvim 最近还在维护吗?

仓库最近一次更新为 2024年8月20日,当前有 37 个未关闭 Issue;Star 数为 871,可作为社区活跃度的参考。

关于

Markdown preview plugin for Neovim

描述取自 GitHub 官方 API,中文内容由 GitRead 中文社区 编辑团队整理。

简要分析

热度分
1910
价值分
633
活跃状态
活跃

语言占比

CSS
HTML
JavaScript
Lua
TypeScript

README

peek.nvim

Markdown preview plugin for Neovim

preview

:sparkles: Features

  • live update
  • synchronized scrolling
  • github-style look
  • TeX math
  • Mermaid diagrams

:battery: Requirements

:electric_plug: Installation

lazy.nvim
{
    "toppair/peek.nvim",
    event = { "VeryLazy" },
    build = "deno task --quiet build:fast",
    config = function()
        require("peek").setup()
        vim.api.nvim_create_user_command("PeekOpen", require("peek").open, {})
        vim.api.nvim_create_user_command("PeekClose", require("peek").close, {})
    end,
},

:wrench: Configuration

-- default config:
require('peek').setup({
  auto_load = true,         -- whether to automatically load preview when
                            -- entering another markdown buffer
  close_on_bdelete = true,  -- close preview window on buffer delete

  syntax = true,            -- enable syntax highlighting, affects performance

  theme = 'dark',           -- 'dark' or 'light'

  update_on_change = true,

  app = 'webview',          -- 'webview', 'browser', string or a table of strings
                            -- explained below

  filetype = { 'markdown' },-- list of filetypes to recognize as markdown

  -- relevant if update_on_change is true
  throttle_at = 200000,     -- start throttling when file exceeds this
                            -- amount of bytes in size
  throttle_time = 'auto',   -- minimum amount of time in milliseconds
                            -- that has to pass before starting new render
})

:paperclip: app option

Preview opens in a webview window by default. You can set this option to 'browser' (will use your default browser as previewer) or specify browser along with arguments:

app = 'chromium'

app = { 'chromium', '--new-window' }

Chromium based browser is recommended.

:bulb: Usage

method
open Open preview window
close Close preview window
is_open Returns true if preview window is currently open

Example command setup:

vim.api.nvim_create_user_command('PeekOpen', require('peek').open, {})
vim.api.nvim_create_user_command('PeekClose', require('peek').close, {})

The following keybinds are active when preview window is focused:

key
k scroll up
j scroll down
u scroll up half a page
d scroll down half a page
g scroll to top
G scroll to bottom

:mag: Preview window

Use your window manager to set preview window properties. Window title is Peek preview.

i3wm examples:

# do not focus preview window on open
no_focus [title="^Peek preview$"]

Use i3-msg to manipulate current layout and open preview window at desired position:

local peek = require('peek')

vim.api.nvim_create_user_command('PeekOpen', function()
  if not peek.is_open() and vim.bo[vim.api.nvim_get_current_buf()].filetype == 'markdown' then
    vim.fn.system('i3-msg split horizontal')
    peek.open()
  end
end, {})

vim.api.nvim_create_user_command('PeekClose', function()
  if peek.is_open() then
    peek.close()
    vim.fn.system('i3-msg move left')
  end
end, {})

评论

暂无评论