Create a comment heading from a selection not exceeding 64 characters in length.
Comment is inserted above selection without mutating selection.
Comment type is selected by the buffer filetype.
Default comment type (no filetype) is configurable with opts.default_style = 'shell'
Note
Possible values of default_style:
apl, clang, clojure, haskell, html, latex, lua, matlab, pascal, python, roxgen2, shell, vim
/*//////////////////////////////////////////////////////////////
THIS IS AN EXAMPLE
//////////////////////////////////////////////////////////////*//lua/plugins/header.lua
local Plugin = { 'sunwukonga/heading.nvim' }
Plugin.keys = {
{
"<leader>ah",
":AddHeading<CR>",
mode = "v",
desc = "Use selected text to splat heading comment",
silent = true,
buffer = true
},
}
Plugins.opts = {
default_style = 'shell'
}
return PluginNote
Default is to use CLANG style
⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝
⍝ ⍝
⍝⍝⍝⍝⍝⍝⍝⍝⍝⍝Note
C, C++, C#, Java, JavaScript, TypeScript, PHP, Kotlin, Scala, Swift, Go, Rust, CSS, SQL, Objective-C, Dart, JSON5
/******
******/(comment ...........
...................){-------
-------}Note
HTML, XML, SGML, Markdown (embedded)
<!-------
-------->Note
tex, latex, erlang
%%%%%%%%%%
% %
%%%%%%%%%%--[[======
========]]%{%%%%%%%%
%%%%%%%%%}{*********
*********}"""''''''
''''''"""#'''''''''
#' #'
#'''''''''
Note
sh, bash, zsh, fish, ps1, asm, fortran, vb, fsharp, julia perl, ruby
##########
# #
##########""""""""""
" "
""""""""""