Skip to content

A simple and useful plugin to generate documentation for cpp.

License

Notifications You must be signed in to change notification settings

paddywz/doxycpp.nvim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

99 Commits
 
 
 
 
 
 
 
 

Repository files navigation

doxycpp.nvim

🎉🎉A simple and useful plugin to generate doxygen style annotation and comment for cpp more easily.🎉🎉

doxycpp_one

Features

  • 🚀Fast
  • ❄️Minimalist and light weight
  • 🎈Independent, not depends on any third-party plugins
  • ✨comment or cancel comment for the code selected when in visual mode
  • 🧨generate doxygen style annotations when the cursor is on the first line of function declaration, class's, etc.

Install

  • lazy.nvim
require('lazy').setup({
  { 'paddywz/doxycpp.nvim', ft = { your filetype }, config = function
    require('doxycpp').setup()
  end},
})
  • packer.nvim
use({
  { 'paddywz/doxycpp.nvim', ft = { your filetype }, config = function
    require('doxycpp').setup()
  end},
})

Cofiguration

default configuration

{
  comment = {
    ['c'] = '//',
    ['cpp'] = '//',
    ['lua'] = '--',
    ['python'] = '#',
    ['cmake'] = '#',
  }
}

custom your comment symbol

the key in table comment is filetype, value is your custom comment symbol

require('doxycpp').setup({
  comment = {
    ['java'] = '//',
  }
})

Keymap

vim.api.nvim_set_keymap('n', 'gcc', '<cmd>Doxycpp<CR>', { noremap = true, silent = true })
vim.api.nvim_set_keymap('v', 'gcc', '<cmd>Doxycpp<CR', { noremap = true, silent = true })

Show

comment showcase

doxycpp_two

annotation showcase

doxycpp_three

ToDo

  • 🌟make it work when the function declaration is crrosing multiple lines.

Note

  • 🌒Don't work on constructor function unfortunately. But I think we don't need to annotate ctor most of the time.

License MIT

About

A simple and useful plugin to generate documentation for cpp.

Topics

Resources

License

Stars

Watchers

Forks

Languages