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 14K
  • Win 10K
  • OS X 2K
  • Linux 2K
Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16 Nov 15 Nov 14 Nov 13 Nov 12 Nov 11 Nov 10 Nov 9 Nov 8 Nov 7 Nov 6 Nov 5 Nov 4 Nov 3 Nov 2 Nov 1 Oct 31 Oct 30
Windows 10 17 21 17 11 12 19 20 21 23 13 10 11 11 26 22 13 16 13 20 13 20 23 21 19 7 11 12 17 19 19 16 11 16 16 20 11 16 23 8 20 25 21 15 21 19
OS X 1 3 3 1 0 0 4 3 4 3 4 2 3 2 4 3 5 1 3 1 1 1 3 3 4 4 1 1 3 3 1 3 3 3 2 2 2 2 3 4 3 4 3 6 0 4
Linux 1 4 2 1 3 1 1 2 4 1 3 4 6 7 3 2 0 1 1 6 4 5 2 8 4 2 5 1 7 0 2 3 2 2 5 2 4 5 2 4 2 5 6 3 5 2

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: