Skip to content

v1nh1shungry/cppman.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cppman.nvim

Search and view the cppreference manuals on the fly, in your favorite editor!

demo

✨ Features

  • View the manuals right inside the neovim.
  • Search in all manuals on the fly. What you can expect from a vscode extension or a browser extension is now available in neovim!
  • K keymap support. In the manual you can press K and jump to the manual for <cword>.
  • Open corresponding cppreference page in browser.

📋 Requirements

  • NVIM >= 0.10.
  • cppman
  • sqlite3, used to query the index database.

📦 Installation

lazy.nvim

{
  "v1nh1shungry/cppman.nvim",
  cmd = "Cppman",
  dependencies = {
    "nvim-telescope/telescope.nvim", -- optional for telescope picker
    "folke/snacks.nvim", -- optional for snacks picker
  },
  opts = {}, -- required, `setup()` must be called
}

⚙️ Configuration

-- default
require('cppman').setup {
  -- * builtin: `vim.ui.select()`
  -- * telescope
  -- * snacks (recommended)
  picker = "builtin",
  -- used in `vim.api.nvim_open_win`
  win = {
    split = "below",
    style = "minimal",
  },
}

NOTE: $XDG_CACHE_HOME/cppman/index.db will be used if it exists, because this one is more likely to be the latest. When you run cppman -r, cppman will rebuild the index database and store it in $XDG_CACHE_HOME/cppman/index.db.

🚀 Usage

API

  • require('cppman').search(): Search in all manuals. Use telescope.nvim if available, otherwise use vim.ui.select().

  • require('cppman').open(keyword, list_all?): find entries contain keyword, if there're multiple matches, the very first one will be picked. Set list_all to true can list all matches.

Command

  • :Cppman [keyword]: calling with no argument will act like search, otherwise open.

Picker Keymap

NOTE: builtin picker does not support any keymap.

Keymap Description
<CR> Open manpage in nvim
<C-o> Open corresponding cppreference page with default browser (vim.ui.open)

About

cppman ❤️ neovim. View cppreference manuals right inside your neovim!

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages