1.2.6 • Published 3 years ago

coc-template v1.2.6

Weekly downloads
42
License
MIT
Repository
-
Last release
3 years ago

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.

npm.io npm.io

Install

:CocInstall coc-template

Configuration

"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.template Insert language template to the current line
  • :CocCommand template.templateTop Insert language template to the first line
  • :CocCommand template.templateBottom Append 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 append to append the template to current buffer
  • Use open to 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

1.2.6

3 years ago

1.2.5

4 years ago

1.2.4

4 years ago

1.2.3

4 years ago

1.2.2

4 years ago

1.2.0

4 years ago

1.2.1

4 years ago

1.1.2

4 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago