django templates (htmldjango) extension for coc.nvim. Provides "formatter", "linter", "completion" and more...
false
)
completionItemProvider
CocInstall:
:CocInstall coc-htmldjango
vim-plug:
Plug 'yaegassy/coc-htmldjango', {'do': 'yarn install --frozen-lockfile'}
Recommended coc extension:
Detection order:
htmldjango.djhtml.commandPath
and htmldjango.djlint.commandPath
settingsdjhtml
and djlint
in "venv")djhtml
and djlint
(Installation commands are also provided)htmldjango.enable
: Enable coc-htmldjango extension, default: true
htmldjango.completion.enable
: Enable snippets completion, default: true
htmldjango.completion.exclude
: Exclude specific key in snippet completion, default: ["autoescape_paste", "comment_paste", "comment_selection", "for_paste", "forempty_paste", "if_paste", "ifelse_paste", "spaceless_paste", "verbatim_paste", "with_selection", "with_paste", "trans_paste", "blocktrans_paste", "blocktrans_with_paste", "translate_paste", "blocktranslate_paste", "blocktranslate_with_paste"]
htmldjango.builtin.pythonPath
: Python 3.x path (Absolute path) to be used for built-in install, default: ""
htmldjango.formatting.provider
: Provider for formatting. Possible options include 'djhtml', 'djlint', and 'none', default: "djhtml"
htmldjango.djhtml.commandPath
: The custom path to the djhtml (Absolute path), default: ""
htmldjango.djhtml.tabWidth
: Set tabwidth (--tabwidth), default: 4
htmldjango.djlint.commandPath
: The custom path to the djlint (Absolute path), default: ""
htmldjango.djlint.enableLint
: Enable djLint lint (diagnostics), default: false
htmldjango.djlint.lintOnOpen
: Lint file on opening, default: true
htmldjango.djlint.lintOnChange
: Lint file on change, default: true
htmldjango.djlint.lintOnSave
: Lint file on save, default: true
htmldjango.djlint.ignore
: Codes to ignore (--ignore
), ex: "W013,W014", default: ""
htmldjango.djlint.indent
: Indent spacing (--indent
), default: 4
htmldjango.djlint.profile
: Enable defaults by template language. ops: html, django, jinja, nunjucks, handlebars, golang and angular, default: ["django"]
htmldjango.djlint.useGitIgnore
: Use .gitignore file to extend excludes (--use-gitignore
), default: false
htmldjango.djlint.preserveLeadingSpace
: Attempt to preserve leading space on text (--preserve-leading-space
), default: false
htmldjango.djlint.preserveBlankLines
: Attempt to preserve blank lines (--preserve-blank-lines
), default: false
htmldjango.showOutput
htmldjango.builtin.installTools
htmldjango.djhtml.format
htmldjango.djlint.format
Example key mapping (Code Action related):
nmap <silent> ga <Plug>(coc-codeaction-line)
Actions:
htmldjango.formatting.provider
is djhtml
Add {# fmt:off #} for this line
Add {# fmt:on #} for this line
htmldjango.formatting.provider
is djlint
or If htmldjango.djlint.enableLint
is true
Add <!-- djlint:off --> for this line
Add <!-- djlint:on --> for this line
coc-htmldjango allows you to create an extension-only "venv" and install "djhtml" and "djlint".
:CocCommand htmldjango.builtin.installTools
MIT
This extension is built with create-coc-extension