v1nh1shungry / cppman.nvim

cppman ❤️ neovim. View cppreference manuals right inside your neovim!
11 stars 0 forks source link

cppman.nvim

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

✨ Features

📋 Requirements

  1. neovim >= 0.9. I haven't had a chance to get a accurate version. I do disable statuscolumn in the plugin and don't check the version, and statuscolumn is available in a recent version.

  2. Make sure curl is available in $PATH. Note that curl is used to download the index database. You can manually download it (if you have already installed cppman you can get it from <cppman-install-directory>/lib/index.db) and place it in $HOME/.local/share/nvim/cppman.db or other directory with configuration. In this case curl is unnecessary.

  3. Make sure cppman is available in $PATH. Sure, you're using CPPMAN!

  4. Make sure sqlite3 is available in $PATH, which is used to query the index database.

📦 Installation

lazy.nvim

{
  'v1nh1shungry/cppman.nvim',
  dependencies = 'nvim-telescope/telescope.nvim', -- optional, if absent `vim.ui.select()` will be used
  opts = {},
}

⚙️ Configuration

-- default
require('cppman').setup {
  -- where the manual window displays
  -- can be 'split', 'vsplit' or 'tab'
  position = 'split',
  -- where the index database stores
  -- you can manually set this option to `<cppman-install-directory>/lib/index.db` to avoid downloading
  index_db_path = vim.fs.joinpath(vim.fn.stdpath('data'), 'cppman.db'),
}

NOTE: even if you set index_db_path, $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. The index database this plugin downloads is from the cppman repository, which is of course not frequently updated. Therefore, if you do want the latest index database, you should execute cppman -r to build one yourself.

🚀 Usage