/vscode-copy-syntax

copy your code with syntax highlight to clipboard, can be used at your slide.

Primary LanguageTypeScript

copy-syntax

Marketplace Version Installs Rating Build Status

copy your code with syntax highlight, can be used at your slide.

Now with vscode 1.10 it supports copy syntax without extra plugin. https://code.visualstudio.com/updates/v1_10#_copy-with-syntax-highlighting But it's copy as HTML format, maybe not work with keynote. This Plugin copy as RTF format to make keynote happy.

Usage

Features

  • Copy code as RTF
  • Auto detect language: markdown syntax -> vscode languageId -> file extension
  • Support language to highlight
  • Use pygmentize and copy-paste

Known issues: Can't work in windows until copy-paste support this feature

Usages

Usage

  • Open code file or select code snippet in Text Editor, then press F1 and then select/type Copy Syntax, or right click the Text Editor and then click Copy Syntax in context menu, the code with syntax highlight will copy to clipboard.
  • To select language to run, use press F1 and then select/type Copy Syntax as ..., then type the language: e.g php, js, bash...

Installation

  • Press F1 in VSCode, type ext install and then look for copy-syntax.
  • python is required by pygmentize

Configuration

  • copy-syntax.defaults.lang: the default language is js

  • copy-syntax.defaults.format: currently is only support rtf, feel free to PR.

  • copy-syntax.showMessage: set to false to skip boring success message

  • copy-syntax.formatters.rtf: RtfFormatter options

    {
      "copy-syntax.defaults.lang": "js",
      "copy-syntax.showMessage": false,
      "copy-syntax.formatters.rtf": {
        "style": "default",
        "fontsize": 24,
        "fontface": "Monaco"
      }
    }

Issues

Submit the issues if you find any bug or have any suggestion.

Contribution

Fork the repository and submit pull requests.

Release Notes

see CHANGELOG