Highlight string as SQL, HTML, CSS or JavaScript in most languages.
在代码中,高亮 SQL、HTML、CSS 或者 JavaScript 代码。
- Visual Studio Code v1.6.0 and above is recommended, but I'm not sure.
- Highlighting
- Commenting
- Bracket matching
- Closing pairs
- Snippets
| Language | Sign pair | Snippets | Comment |
|---|---|---|---|
| SQL | --sql, ; |
- | |
| SQL | --beginsql, --endsql |
hsql, highlight-sql |
|
| SQL | --begin-sql, --end-sql |
- | |
| SQL | UPPERCASE KEYWORD, ; |
- | |
| Hive SQL | --hive, --!hive |
hhsql, highlight-hive-sql |
Hive SQL is required |
| HTML | <!--html-->, <!--!html--> |
hhtml, highlight-html |
|
| CSS | /*css*/, /*!css*/ |
hcss, highlight-css |
|
| JS | //js, //!js |
hjs, highlight-javascript |
|
| Yaml | --- #yaml, #!yaml |
hyaml, highlight-yaml |
- SQL
- Insert sign pair
--sqland;to highlight single SQL sequence.
single SQL stirng with Sign - Insert sign pair
--beginsqlor--begin-sqland--endsqlor--end-sqlto highlight one and more SQL suquences.
multi SQL stirng with Sign - Any SQL sequence starts with UPPERCASE keyword (such as
SELECT,INSERT,UPDATEand etc) and one of WHITESPACE character(such as' ','\n','\t','\r','\f'), and ends with;will be highlighted automatically.
SQL stirng no Sign
- Insert sign pair
- HTML, CSS, JS
- Insert sign pairs
<!--html-->and<!--!html-->,/*css*/and/*!css*/,//jsand//!jsto highlight one and more HTML, CSS or JS suquences. Other comments can be added after language name.
HTML with Sign
- Insert sign pairs
- Yaml
- Insert sign pairs
--- #yamland#!yamlto highlight YAML suquences.
- Insert sign pairs
- Other
- Highlight Variables between
{and}in highlighted string code forSQLandHTMLstring. The idea is forpythonandshell, but works for any language now.
Variables
- Highlight Variables between
- Snippets
- Type
h{language_abbr}orhighlight-{language_name}to insert a highlight block sign pair. For example, typehjsorhighlight-javascriptto insert// jsand// !js. Snippets
- Type
- Install from VS Code extensions (
ctrl + shift + xorcmd + shift + xon mac). - Install from VSIX manually.
- Modify js highlight pattern to fix Issue#5.
- Add "\s*" pattern before some signs to fix Issue#1.
- Add yaml support
- Fix typos.
Please see CHANGELOG.md for more information.
If you have any suggestion or issue, please feel free to submit it at Github Issues page. Any pull requests to add more features or improve the experience are also welcome.
- Forked from bashmish/es6-string-css > ptweir/python-string-sql
- Visual Studio Code Extension API
- TextMate Manual
- Issue Highlighting of fenced code in markdown for known but non-default languages