coc-htmldjango v0.14.22
coc-htmldjango
django templates (htmldjango) extension for coc.nvim. Provides "formatter", "linter", "completion" and more...
Features
- Format
- Lint
- Completion
- Completion of snippets data via
completionItemProvider
- Completion of snippets data via
- Hover | DEMO
- CodeAction | DEMO
- Commands
- Built-in installer (djLint, DjHTML)
Install
CocInstall:
:CocInstall coc-htmldjangovim-plug:
Plug 'yaegassy/coc-htmldjango', {'do': 'yarn install --frozen-lockfile'}Recommended coc-extensions to install together
Tool (linter & formatter) detection
Detection order:
htmldjango.djlint.commandPathandhtmldjango.djhtml.commandPathsettings- current python environment (e.g.
djlintanddjhtmlin "venv") - builtin
djlintanddjhtml(Installation commands are also provided)
Configuration options for coc-htmldjango
htmldjango.enable: Enable coc-htmldjango extension, default:truehtmldjango.completion.enable: Enable snippets completion, default:truehtmldjango.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 'djlint', 'djhtml' and 'none', default:"djlint"htmldjango.djlint.commandPath: The custom path to the djlint (Absolute path), default:""htmldjango.djlint.enableLint: Enable djLint lint (diagnostics), default:truehtmldjango.djlint.lintOnOpen: Lint file on opening, default:truehtmldjango.djlint.lintOnChange: Lint file on change, default:truehtmldjango.djlint.lintOnSave: Lint file on save, default:truehtmldjango.djlint.include: Codes to include (--include), ex: "H014,H017", default:""htmldjango.djlint.ignore: Codes to ignore (--ignore), ex: "W013,W014", default:""htmldjango.djlint.ignoreCase: Do not fix case on known html tags (--ignore-case), default:falsehtmldjango.djlint.ignoreBlocks: Comma list of template blocks to not indent (--ignore-blocks), default:""htmldjango.djlint.indent: Indent spacing (--indent), default:4htmldjango.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:falsehtmldjango.djlint.preserveLeadingSpace: Attempt to preserve leading space on text (--preserve-leading-space), default:falsehtmldjango.djlint.preserveBlankLines: Attempt to preserve blank lines (--preserve-blank-lines), default:falsehtmldjango.djlint.formatCss: Also format contents of style tags (--format-css), default:falsehtmldjango.djlint.formatJs: Also format contents of script tags (--format-js), default:falsehtmldjango.djlint.addLinterArgs: Additional arguments passed to djlint linter, example:["--max-line-length", "250", "--max-attribute-length", "80"], default:[]htmldjango.djlint.addFormatterArgs: Additional arguments passed to djlint formatter, example:["--max-line-length", "250", "--max-attribute-length", "80"], default:[]htmldjango.djhtml.commandPath: The custom path to the djhtml (Absolute path), default:""htmldjango.djhtml.tabWidth: Set tabwidth (--tabwidth), default:4
Commands
htmldjango.showOutput: Show htmldjango output channelhtmldjango.builtin.installTools: Install htmldjango related toolshtmldjango.djlint.format: Run djLint formathtmldjango.djhtml.format: Run DjHTML formathtmldjango.showReferences: Show Variables Block ({{ ... }}) or TemplateTags Block ({% ... %}) location information for the current file
Code Actions
Example key mapping (Code Action related):
nmap <silent> ga <Plug>(coc-codeaction-line)Actions:
- If
htmldjango.formatting.providerisdjlintor Ifhtmldjango.djlint.enableLintistrueAdd <!-- djlint:off --> for this lineAdd <!-- djlint:on --> for this line
- If
htmldjango.formatting.providerisdjhtmlAdd {# fmt:off #} for this lineAdd {# fmt:on #} for this line
Bult-in install (djLint, DjHTML)
coc-htmldjango allows you to create an extension-only "venv" and install "djlint" and "djhtml".
:CocCommand htmldjango.builtin.installToolsThanks
License
MIT
This extension is built with create-coc-extension
10 months ago
11 months ago
12 months ago
12 months ago
12 months ago
12 months ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago