Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/madskjeldgaard/cppman.nvim

Search cppman (cplusplus.com and cppreference) from within neovim
https://github.com/madskjeldgaard/cppman.nvim

cpp cppman lua neovim neovim-plugin nvim nvim-plugin

Last synced: about 18 hours ago
JSON representation

Search cppman (cplusplus.com and cppreference) from within neovim

Awesome Lists containing this project

README

        

# CPPMan.nvim

![in action](cppman.gif)

A NeoVim plugin with a simple interface for the [cppman cli tool](https://github.com/aitjcize/cppman), allowing you to easily search cplusplus.com and cppreference.com without ever leaving neovim.

Plugin inspired by [vim-cppman](https://github.com/gauteh/vim-cppman)

## Installation

Install using packer. Note that [nui.nvim](https://github.com/MunifTanjim/nui.nvim) is a requirement.

```lua
-- cppman
use {
'madskjeldgaard/cppman.nvim',
requires = {
{ 'MunifTanjim/nui.nvim' }
},
config = function()
local cppman = require"cppman"
cppman.setup()

-- Make a keymap to open the word under cursor in CPPman
vim.keymap.set("n", "cm", function()
cppman.open_cppman_for(vim.fn.expand(""))
end)

-- Open search box
vim.keymap.set("n", "cc", function()
cppman.input()
end)

end
}
```

## Usage

Run `:CPPMan` without any arguments to get a search prompt or with an argument to search for a term: `:CPPMan std::array`

## Navigation
Once the manual has been open it's possible to navigate through the documentation using the same keybindings of the standalone cppman program, in normal mode:
* **K**, **** and **<2-LeftMouse>**: allows to follow the word under cursor
* **\** and **\**: go back to the previous page