Skip to content

iuyoy/highlight-string-code

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Highlight String Code

Highlight string as SQL, HTML, CSS or JavaScript in most languages.

在代码中,高亮 SQL、HTML、CSS 或者 JavaScript 代码。

Documents

English | 中文文档

Requirements

  • Visual Studio Code v1.6.0 and above is recommended, but I'm not sure.

Features

  • Highlighting
  • Commenting
  • Bracket matching
  • Closing pairs
  • Snippets

Usages

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
    1. Insert sign pair --sql and ; to highlight single SQL sequence.
      single SQL stirng with Sign
    2. Insert sign pair --beginsql or --begin-sql and --endsql or --end-sql to highlight one and more SQL suquences.
      multi SQL stirng with Sign
    3. Any SQL sequence starts with UPPERCASE keyword (such as SELECT, INSERT, UPDATE and etc) and one of WHITESPACE character(such as ' ','\n','\t','\r','\f'), and ends with ; will be highlighted automatically.
      SQL stirng no Sign
  • HTML, CSS, JS
    • Insert sign pairs <!--html--> and <!--!html-->, /*css*/ and /*!css*/, //js and //!js to highlight one and more HTML, CSS or JS suquences. Other comments can be added after language name.
      HTML with Sign
  • Yaml
    • Insert sign pairs --- #yaml and #!yaml to highlight YAML suquences.
  • Other
    • Highlight Variables between { and } in highlighted string code for SQL and HTML string. The idea is for python and shell, but works for any language now.
      Variables
  • Snippets
    • Type h{language_abbr} or highlight-{language_name} to insert a highlight block sign pair. For example, type hjs or highlight-javascript to insert // js and // !js. Snippets

Installation

  • Install from VS Code extensions (ctrl + shift + x or cmd + shift + x on mac).
  • Install from VSIX manually.

Release Notes

[v0.4.5]

  • Modify js highlight pattern to fix Issue#5.

[v0.4.4]

  • Add "\s*" pattern before some signs to fix Issue#1.

[v0.4.3]

  • Add yaml support
  • Fix typos.

Please see CHANGELOG.md for more information.

Issues

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.

References