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

Console Wrap for js

by David Bekoyan ST2/ST3

Console log selected variable

Details

Installs

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

Readme

Source
raw.​githubusercontent.​com

ConsoleWrap for JS

Summary

This plugin places your selected variable in console.log as console.log('variable' , variable); javascript only. THIS IS NOT A SNIPPET.

Screenshot

ScreenShot

Install

Git Clone

Clone this repository in to the Sublime Text “Packages” directory, which is located where ever the “Preferences” -> “Browse Packages” option in sublime takes you.

Key Binding

The default key binding is “ctrl+shift+q” and “ctrl+shift+alt+q” (insert before selection).

Key Binding Conflicts

Unfortunately there are other plugins that use “ctrl+shift+q”, this is a hard problem to solve. If consolewrap doesn't work, then you have two options:

  1. Add {"keys": ["ctrl+shift+q"], "command": "consolewrap"} to your user keybindings file. This will override anything specifid by a plugin.
  2. Find the offending plugin, and change the shortcut in its sublime-keymap file (will revert on updates).

Usage

First you need to select a variable and press “ctrl+shift+q”. The console.log line will appear on the next line. Press “ctrl+shift+q” again to change wrapping (info,warn etc.)

You can Also remove or comment all console.logs from your selsection or from all document

Edit settings to format output

{
    /*
        you can customize consoleStr as you wish for example "{title}, tmpVal = {variable}" to assigne value to temporary parameter output: console.log('title', tmpVal = variable);
    */
    "consoleStr": "{title}, {variable}",
    "consoleFunc": ["console", "log"], // you can change default log statement for example ["logger", "info"] output: logger.info('title', variable);
    "single_quotes": false, // if true output: console.log('title', variable);
    "supportedFileTypes" : [
        "text.html.vue",
        "source.ts",
        "source.tsx",
        "source.coffee",
        "source.js",
        "text.html.basic",
        "text.html.blade",
        "text.html.twig"
    ],
    "log_types": ["log", "info", "warn", "error"]
}