0.14.13 • Published 5 months ago

coc-htmldjango v0.14.13

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

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
  • Hover | DEMO
  • CodeAction | DEMO
  • Commands
  • Built-in installer (djLint, DjHTML)

Install

CocInstall:

:CocInstall coc-htmldjango

vim-plug:

Plug 'yaegassy/coc-htmldjango', {'do': 'yarn install --frozen-lockfile'}

Recommended coc-extensions to install together

Tool (linter & formatter) detection

Detection order:

  • htmldjango.djlint.commandPath and htmldjango.djhtml.commandPath settings
  • current python environment (e.g. djlint and djhtml in "venv")
  • builtin djlint and djhtml (Installation commands are also provided)

Configuration options for coc-htmldjango

  • 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 '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: true
  • 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.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: false
  • htmldjango.djlint.ignoreBlocks: Comma list of template blocks to not indent (--ignore-blocks), 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.djlint.formatCss: Also format contents of style tags (--format-css), default: false
  • htmldjango.djlint.formatJs: Also format contents of script tags (--format-js), default: false
  • htmldjango.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 channel
  • htmldjango.builtin.installTools: Install htmldjango related tools
  • htmldjango.djlint.format: Run djLint format
  • htmldjango.djhtml.format: Run DjHTML format
  • htmldjango.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.provider is djlint or If htmldjango.djlint.enableLint is true
    • Add <!-- djlint:off --> for this line
    • Add <!-- djlint:on --> for this line
  • If htmldjango.formatting.provider is djhtml
    • Add {# fmt:off #} for this line
    • Add {# 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.installTools

Thanks

License

MIT


This extension is built with create-coc-extension

0.14.13

5 months ago

0.14.12

5 months ago

0.14.11

8 months ago

0.14.10

11 months ago

0.14.9

11 months ago

0.14.5

12 months ago

0.14.6

12 months ago

0.14.7

12 months ago

0.14.8

11 months ago

0.13.0

1 year ago

0.12.10

1 year ago

0.14.0

1 year ago

0.14.1

1 year ago

0.14.2

1 year ago

0.14.3

1 year ago

0.14.4

1 year ago

0.12.9

1 year ago

0.12.7

1 year ago

0.12.8

1 year ago

0.12.6

1 year ago

0.12.4

1 year ago

0.12.5

1 year ago

0.12.2

1 year ago

0.12.3

1 year ago

0.12.1

1 year ago

0.11.30

1 year ago

0.11.31

1 year ago

0.11.32

1 year ago

0.11.33

1 year ago

0.11.34

1 year ago

0.11.35

1 year ago

0.11.36

1 year ago

0.12.0

1 year ago

0.11.26

2 years ago

0.11.27

2 years ago

0.11.28

2 years ago

0.11.29

2 years ago

0.11.22

2 years ago

0.11.23

2 years ago

0.11.24

2 years ago

0.11.25

2 years ago

0.11.20

2 years ago

0.11.21

2 years ago

0.11.19

2 years ago

0.11.15

2 years ago

0.11.16

2 years ago

0.11.17

2 years ago

0.11.18

2 years ago

0.11.11

2 years ago

0.11.12

2 years ago

0.11.13

2 years ago

0.11.14

2 years ago

0.11.8

2 years ago

0.11.9

2 years ago

0.11.0

2 years ago

0.10.14

2 years ago

0.11.1

2 years ago

0.10.15

2 years ago

0.11.2

2 years ago

0.11.3

2 years ago

0.11.4

2 years ago

0.10.10

2 years ago

0.11.5

2 years ago

0.10.11

2 years ago

0.11.6

2 years ago

0.10.12

2 years ago

0.11.7

2 years ago

0.10.13

2 years ago

0.10.9

2 years ago

0.10.6

2 years ago

0.10.7

2 years ago

0.10.8

2 years ago

0.11.10

2 years ago

0.10.2

2 years ago

0.10.3

2 years ago

0.10.4

2 years ago

0.10.5

2 years ago

0.10.1

2 years ago

0.10.0

2 years ago

0.9.8

2 years ago

0.9.0

2 years ago

0.9.2

2 years ago

0.9.1

2 years ago

0.8.23

2 years ago

0.9.7

2 years ago

0.8.22

2 years ago

0.9.4

2 years ago

0.9.3

2 years ago

0.9.6

2 years ago

0.8.21

2 years ago

0.9.5

2 years ago

0.8.20

2 years ago

0.8.19

2 years ago

0.8.16

2 years ago

0.8.15

2 years ago

0.8.18

2 years ago

0.8.17

2 years ago

0.8.9

3 years ago

0.8.12

2 years ago

0.8.11

2 years ago

0.8.14

2 years ago

0.8.13

2 years ago

0.8.10

2 years ago

0.8.8

3 years ago

0.8.7

3 years ago

0.8.5

3 years ago

0.8.4

3 years ago

0.8.6

3 years ago

0.8.1

3 years ago

0.8.0

3 years ago

0.8.3

3 years ago

0.8.2

3 years ago

0.7.3

3 years ago

0.7.2

3 years ago

0.7.1

3 years ago

0.7.0

3 years ago

0.6.3

3 years ago

0.6.2

3 years ago

0.6.1

3 years ago

0.6.0

3 years ago

0.5.2

3 years ago

0.5.1

3 years ago

0.5.0

3 years ago

0.4.4

3 years ago

0.4.3

3 years ago

0.3.0

3 years ago

0.4.1

3 years ago

0.4.0

3 years ago

0.4.2

3 years ago

0.2.0

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago