Skip to content

LazyBeaver007/NCppDocs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

cppdocs.nvim

image

Search and view offline C++ reference HTML (e.g. a cppreference HTML dump) inside Neovim.

Setup

-- lazy.nvim example (local plugin directory)
{
  dir = vim.fn.stdpath("config") .. "/lua/CppDocs",
  config = function()
    require("cppdocs").setup({
      docs_root = "D:/html_book_20190607/reference/en",
    })
  end,
}

Get the HTML docs

You need an offline copy of the C++ reference site in HTML form.

One convenient source is the cppreference HTML archive mirror:

https://github.com/stdman3/cppreference-archive-html

Download an archive from that repo, extract it somewhere, then point docs_root at the extracted reference/en directory (the folder that contains lots of *.html files).

Manual install (no plugin manager)

Add this repo to your runtimepath (early in startup, before :CppSearch is used):

vim.opt.rtp:append(vim.fn.stdpath("config") .. "/lua/CppDocs")

“Copy into config” install (not recommended)

If you copy plugin/cppdocs.lua into ~/.config/nvim/plugin/, you must also copy lua/cppdocs/* into ~/.config/nvim/lua/cppdocs/ so require("cppdocs.*") can resolve.

Usage

  • :CppSearch {query}: fuzzy-search by HTML filename (without .html) and open the best match in a scratch split.
  • :CppReindex: rebuild the in-memory index (useful after changing docs_root).

Notes

  • Indexing is done once per Neovim session (first :CppSearch call) by recursively scanning docs_root for *.html.
  • Rendering extracts content starting at #mw-content-text and converts HTML to a markdown-ish buffer for reading.

About

Neovim plugin to fuzzy-search and read an offline cppreference HTML dump (from the official html_book zip) directly inside Neovim.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages