Coder Social home page Coder Social logo

truncated / vscode-hide-comments Goto Github PK

View Code? Open in Web Editor NEW

This project forked from estruyf/vscode-hide-comments

0.0 0.0 0.0 548 KB

This extension started as a joke for people who do not like to see comments in the code. The extension will basically set all comments to transparent, they will not be removed.

Home Page: https://marketplace.visualstudio.com/items?itemName=eliostruyf.vscode-hide-comments

License: MIT License

TypeScript 100.00%

vscode-hide-comments's Introduction

Hide Comments

Hide Comments - VSCode Extension

Visual Studio Marketplace Number of installs Ratings Buy me a coffee

This extension started as a joke for people who do not like to see comments in the code. The extension will set all comments to transparent. The extension will never remove the comments from the file.

Important: Although it might have been started as a joke. There might be people out there that would actually like to hide the comments in their projects. That is why I will keep this project alive.

Usage

When the extension is installed. You can use the Hide Comments commands to show or hide the comments.

If you want, you can also let the extension ask you each time when you start a new instance if you want to hide the comments. You can do this by enabling the hideComments.defaultEnabled setting. When this is set to true, you will get the following notification when you start a new instance:

Do you want to hide the comments of this project?

When you choose Yes it will at the settings to your user settings for this project. If you decide No, nothing will happen at all.

Menu editor title actions

On the editor title, a toggle action is available to show/hide the comments quickly.

Title bar action toggle

Note: In case you are using the hideComments.regex setting to hide additional lines with custom regex, you will have a second toggle action available.

Settings

  • hideComments.backup: Used to backup the previous comments value (if set). Default: null.
  • hideComments.color: Defines the color for hiding the comments. Default: #00000000.
  • hideComments.defaultEnabled: Define if you want to enable or disable the extension on startup of Visual Studio Code. Default: false.
  • hideComments.cleanStart: Define if you want to start each instance by showing the comments in your files. Default: true.
  • hideComments.regex: Specify the regular expression to use to hide additional lines. Default: null.

Commands

The extension currently has the following commands:

  1. Hide Comments: Toggle the show/hide of all comments
  2. Hide Comments: Hide all comments
  3. Hide Comments: Show all comments
  4. Hide Comments: Show lines by regex: this command is only available when the hideComments.regex setting is set.
  5. Hide Comments: hide lines by regex: this command is only available when the hideComments.regex setting is set.

Keybindings

The extension does not have any default keybindings. You can add your own keybindings to the commands from within Visual Studio Code it UI. Steps to do this:

  1. Open the command palette: Ctrl+Shift+P or Cmd+Shift+P;
  2. Type the command you want to add a keybinding. Example: Hide Comments: Toggle the show/hide of all comments;
  3. Click on the gear icon next to the command in the command palette. This opens the keyboard shortcuts editor;
  4. Add your keybinding and you are all set.

Hide additional lines by regex

In case you want to hide additional lines with a custom regex, you can use the hideComments.regex setting. Here is an example:

{
  "hideComments.regex": [
    {
      "regex": "console\\.log\\(([^)]+)\\).*",
      "flags": "igm"
    }
  ]
}

Removing the extension

When you want to remove the extension, but still have the comments hidden. It is best to first run the Hide Comments: Show all comments command. This will make sure that all settings will be reset.

If you did already uninstall the extension, but still your comments are hidden. Here is what you can do:

  • Open your workspace settings via: Preferences: Open Workspace Settings (JSON)
  • Remove the following code from the JSON file:
"editor.tokenColorCustomizations": {
  ...
}

Feedback / issues / ideas

Please submit them via creating an issue in the project repository: issue list.

vscode-hide-comments's People

Contributors

estruyf avatar truncated avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.