Skip to content

🎨 Comment-Art.nvim: Beautiful Neovim comment art generator - One-click Buddha's blessing & Guardian creature patterns | Supports C, C++, JS, TS, Python and more 🎨 Neovim注释美化插件:一键生成佛祖保佑/神兽护体趣味图案 | 支持C/C++/JS/TS/Python多语言注释

License

Notifications You must be signed in to change notification settings

ChuYanLon/comment-Art

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Comment-Art.nvim 🎨

English | 中文

Generate beautiful comment art in Neovim
创建精美的 Neovim 注释艺术图案
Multi-language ASCII art generator with custom patterns | 支持自定义图案的多语言字符画生成工具

Comment-Art.nvim is a Neovim plugin for quickly generating multi-language supported comment patterns (ASCII Art) to enhance visual separation and aesthetics in code documentation.

📸 Screenshots

Selector

Comment-Art Screenshot

Buddha's Blessing

Comment-Art Screenshot

Scallion Dancer

Comment-Art Screenshot

✨ Features

  • Multi-language support: Supports major programming languages including C, C++, JavaScript, TypeScript, Python, Lua, Java, Rust, etc.
  • Built-in pattern library: Includes fun preset patterns like "Buddha's Blessing", "Mythical Creature Protection", and "Scallion Dance"
  • Quick insertion:Insert directly at cursor position via command or keyboard shortcut

📦 Installation

use {
  'ChuYanLon/comment-Art',
  config = function()
    require('comment-art').setup()
  end
}

Using lazy.nvim

{
  'ChuYanLon/comment-Art',
  opts = {},
}

⚙️ Default Configuration

{
  data_path = vim.fn.stdpath('data') .. '/lazy/comment-Art/lua/comment-art/data.txt',
  data_en_path = vim.fn.stdpath('data') .. '/lazy/comment-Art/lua/comment-art/data-en.txt',
  language = 'english', -- 'english' or 'chinese' 
  prompt = {
    title_en = 'Generate pattern note:',
    title="生成图案注释:",
  },
  rules = {
    ['c'] = { prefix = '/* ', suffix = '*/', line_prefix = '* ', lines = true },
    ['cpp'] = { prefix = '/* ', suffix = '*/', line_prefix = '* ', lines = true },
    ['javascript'] = { prefix = '/* ', suffix = '*/', line_prefix = '* ', lines = true },
    ['typescript'] = { prefix = '/* ', suffix = '*/', line_prefix = '* ', lines = true },
    ['css'] = { prefix = '/* ', suffix = '*/', line_prefix = '* ', lines = true },
    ['scss'] = { prefix = '/* ', suffix = '*/', line_prefix = '* ', lines = true },
    ['vue'] = { prefix = '/* ', suffix = '*/', line_prefix = '* ', lines = true },
    ['javascriptreact'] = { prefix = '/* ', suffix = '*/', line_prefix = '* ', lines = true },
    ['typescriptreact'] = { prefix = '/* ', suffix = '*/', line_prefix = '* ', lines = true },
    ['python'] = { prefix = "'''", suffix = "'''", line_prefix = '', lines = true },
    ['sh'] = { prefix = '###', suffix = '###', line_prefix = '# ', lines = true },
    ['zsh'] = { prefix = '###', suffix = '###', line_prefix = '# ', lines = true },
    ['lua'] = { prefix = '--[[ ', suffix = ']]--', line_prefix = '', lines = true },
    ['java'] = { prefix = '/* ', suffix = '*/', line_prefix = '* ', lines = true },
    ['rust'] = { prefix = '/* ', suffix = '*/', line_prefix = '* ', lines = true },
    ['go'] = { prefix = '/* ', suffix = '*/', line_prefix = '', lines = true },
    ['less'] = { prefix = '// ', suffix = '', line_prefix = '// ' },
    ['html'] = { prefix = '<!-- ', suffix = '-->', line_prefix = '* ', lines = true },
    ['markdown'] = { prefix = '<!-- ', suffix = '-->', line_prefix = '', lines = true },
  }
}

📜 Command

:CommentArt

📖 Usage

vim.keymap.set('n', '<leader>cs', ':CommentArt<CR>', { desc = 'Generate pattern note' })

📜 Contributions

PRs and Issues are welcome! Please share your creative patterns or feature suggestions.

📄 License

This project uses the MIT License . You can freely use, modify, and distribute the code while retaining the author information.

About

🎨 Comment-Art.nvim: Beautiful Neovim comment art generator - One-click Buddha's blessing & Guardian creature patterns | Supports C, C++, JS, TS, Python and more 🎨 Neovim注释美化插件:一键生成佛祖保佑/神兽护体趣味图案 | 支持C/C++/JS/TS/Python多语言注释

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages