ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

HTML Nest Comments

by philsinatra ST2/ST3

This is a Sublime Text 2 and 3 plugin allowing you to quickly comment out blocks of HTML code that already contain HTML comments.

Details

Installs

  • Total 13K
  • Win 9K
  • OS X 2K
  • Linux 2K
Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17 Sep 16 Sep 15 Sep 14 Sep 13 Sep 12 Sep 11 Sep 10 Sep 9 Sep 8 Sep 7 Sep 6 Sep 5
Windows 11 14 21 24 14 13 18 18 23 18 22 20 14 20 12 24 17 15 12 15 19 18 15 21 24 39 16 13 20 18 23 18 25 17 20 22 32 19 13 4 11 15 10 24 15 13
OS X 0 2 3 4 2 1 1 1 4 5 4 5 3 5 3 3 5 2 7 4 2 1 2 5 0 1 2 0 4 4 5 6 2 0 2 3 5 3 3 1 2 2 7 2 5 1
Linux 1 3 6 3 1 3 1 3 2 1 1 3 2 2 2 3 2 8 5 2 2 4 4 3 4 12 1 1 5 8 5 2 1 2 5 1 4 2 5 4 4 1 4 2 6 8

Readme

Source
raw.​githubusercontent.​com

GitHub tag Package Control license

HTML Nest Comments for Sublime Text

About

This is a Sublime Text 2 and 3 plugin allowing you to quickly comment out blocks of HTML code that already contain HTML comments.

example image

Installation

The easy way is:

Through Sublime Package Manager

  • Ctrl+Shift+P or Cmd+Shift+P in Linux/Windows/OS X
  • type install, select Package Control: Install Package
  • type htmlnest, select HTML-Nest-Comments

Manually

Make sure you use the right Sublime Text folder. For example, on OS X, packages for version 2 are in ~/Library/Application\ Support/Sublime\ Text\ 2, while version 3 is labeled ~/Library/Application\ Support/Sublime\ Text\ 3.

These are for Sublime Text 3:

Mac

git clone https://github.com/philsinatra/HTML-Nested-Comments.git ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/HTML-Nest-Comments

Linux

git clone https://github.com/philsinatra/HTML-Nested-Comments.git ~/.config/sublime-text-3/Packages/HTML-Nest-Comments

Windows

git clone https://github.com/philsinatra/HTML-Nested-Comments.git %APPDATA%/Sublime\ Text\ 3/Packages/HTML-Nest-Comments

Usage

Tools -> Command Palette (Ctrl+Shift+P or Cmd+Shift+P) and type nested.

– or –

Ctrl+Shift+/ (or Cmd+Shift+/ if you're on a Mac).

– or –

Right click in the current buffer and select HTML Nest Comments -> Comment/Uncomment Selection.

– or –

Open an HTML file, pop out the console in Sublime Text from View -> Show Console, and type view.run_command("nest").

Writing commands in the console is ugly. Set up your own key combo for this, by going to Preferences -> Key Bindings - User, and adding a command in that array: { "keys": ["super+shift+/"], "command": "nest" }. You can use any other command you want, thought most of them are already taken.

What Happens

The built in comment function in Sublime Text runs into an issue if your HTML code contains comments that you want to maintain while block commenting larger areas of code. This plugin will temporarily disable the nested comments so that you can bulk comment out blocks of HTML that already contain comments.

<div class="container">
  <div class="main">
    <div class="content"></div>

    <aside></aside>
  </div>

</div>

Each of the existing comment tags will be replaced with <!~~ or ~~> respectively when commenting, and then the effect will be reversed when uncommenting.

Run the nest command and the code is transformed into: