QuoteWithMarker
QuoteWithMarker is an extension that quotes the selected area and adds a custom marker to it.
Feature
Sometimes you have to mark and comment code. Here is the QuoteWithMarker very helpful. This function quotes the selected area and adds a custom marker to it. This way you can still trace the original code. There is also a start and end block for better display when merging.
QuoteWithMarker can be very useful especially for patch files.
Shortcut (quote): Ctrl+Alt+K then Q (Windows/Linux) — see keybindings in the extension.
Commands (Command Palette)
Open the palette (Ctrl+Shift+P / Cmd+Shift+P) and search for QuoteWithMarker:
- Quote with Marker. — Quotes the selection (or current line) and inserts the marker block; the original text is included once as comments and once plain (for patch-style workflows).
- Insert marker frame only. — Inserts only the header/footer marker block and a small note area, without duplicating the selection body.
- Set code marker… — Change
quoteWithMarker.codeMarkerwithout opening Settings.
Set code marker…
- Quick Pick — Choose a starting value:
- Current marker — The value from your settings (bookmark icon).
- Workspace folder — The folder name of the open workspace (handy as a short repository label).
- Recently used — Previously chosen or used markers (stored in the extension; shared across windows).
- New… — Start from the current setting and edit in the next step.
- Input box — Adjust the string (e.g. add or change
${year},${month},${day}). If the text does not yet contain${year}, the extension offers a default suffix: a space, hyphen, space, and${year}.${month}.${day}(same idea as the built-in default). Confirm to save.
The setting is written to workspace settings when a folder is open, otherwise to user settings. Using Quote with Marker or Insert marker frame only also refreshes the recent markers list (using the template before date substitution).
Works for the following languages:
| LanguageID | LineComment | | ----------------------- | ----------- | | bat | @REM | | clojure | ;; | | CoffeeScript | # | | c | // | | cpp | // | | cuda-cpp | // | | csharp | // | | CSS | | | dart | // | | diff | # | | Dockerfile | # | | fsharp | // | | git-commit | # | | git-rebase | # | | ignore | # | | go | // | | groovy | // | | handlebars | | | hlsl | // | | HTML | | | ini | ; | | plaintext | # | | Java | // | | javascriptreact | // | | JavaScript | // | | jsx-tags | | | JSON | // | | jsonc | // | | jsonl | // | | julia | # | | tex | % | | LaTeX | % | | cpp_embedded_latex | // | | markdown_latex_combined | | | less | // | | lua | -- | | Makefile | # | | Markdown | | | objective-c | // | | objective-cpp | // | | perl | # | | perl6 | # | | php | // | | PowerShell | # | | jade | //- | | python | # | | r | # | | razor | | | restructuredtext | .. | | ruby | # | | rust | // | | SCSS | // | | shaderlab | // | | shellscript | # | | SQL | -- | | swift | // | | TypeScript | // | | typescriptreact | // | | vb | ' | | XML | | | xsl | | | dockercompose | # | | YAML | # |Settings
Preferences -> Settings -> Extensions -> QuoteWithMarker
| Name | Description | Default Value |
|---|---|---|
| quoteWithMarker.codeMarker | Code Marker used in QuoteWithMarker function. | MyMarker - ${year}.${month}.${day} |
| quoteWithMarker.lineComment | This is a mapping between LanguageID and lineComment characters. | All possible lineComment’s |
Installation
To install this extension, you have three options:
1. Search Extension in Marketplace
Search and install online extension via VSC extensions menu.
Code -> Preferences -> Extensions simply search for QuoteWithMarker to install.
2. Install via vsix file
Download latest vsix file and install via extensions menu.
Code -> Preferences -> Extensions -> Views and More Action -> Install from VSIX.
3. Source code
Download archive with the latest release and unpack it to Visual Studio Code extensions folder $HOME/.vscode/extensions/.
Download
For download see VSCode-QuoteWithMarker
Enjoy!
Your Denny Korsukéwitz 🚀

