1.2.6 • Published 5 years ago
coc-template v1.2.6
coc-template
Language template or fileheader-like extension for coc.nvim
A simple plugin that will allow you to have a set of templates for certain file types. It is useful to add boilerplate code like guards in C/C++ headers, gitignore templates, or license disclaimers.

Install
:CocInstall coc-templateConfiguration
"template.email": {
"type": "string",
"default": null,
"description": "If null, will use the value from `git config --global user.email`"
},
"template.username": {
"type": "string",
"default": null,
"description": "If null, will use the value from `git config --global user.username`"
},
"template.license": {
"type": "string",
"default": "MIT",
"description": ""
},
"template.templatesDirectory": {
"type": "string",
"default": null,
"description": "Directory of template files"
}You can read doc to see how to writing a template file
Keymaps
- normal mode:
<Plug>(coc-template)Append language template to the current line - normal mode:
<Plug>(coc-template-top)Insert language template to the first line - normal mode:
<Plug>(coc-template-bottom)Append language template to the last line
Commands
:CocCommand template.templateInsert language template to the current line:CocCommand template.templateTopInsert language template to the first line:CocCommand template.templateBottomAppend language template to the last line
CocList
Run :CocList template to open the translation list.
- Filter your translation items and perform operations via
<Tab> - Use
appendto append the template to current buffer - Use
opento edit your template file
F.A.Q
- How to make coc-template add template automatically while an empty buffer is being created?
Use
autocmd, e.g.autocmd BufNewFile .gitignore CocCommand template.templateTop
Reference
License
MIT