Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/midnightsyntax/vscode-wrap-console-log

Visual Studio Code extension for fast console.log:ing
https://github.com/midnightsyntax/vscode-wrap-console-log

keyboard-shortcuts vscode-extension

Last synced: 3 months ago
JSON representation

Visual Studio Code extension for fast console.log:ing

Awesome Lists containing this project

README

        

# Wrap Console Log

This extension wraps the word near your cursor and replaces it as an argument for `console.log`.

## Key features

* Optimized for keyboard use
* No selection needed
* Wrap and replace for fast logging
* Doesn't break indent
* Can log variables with and without prefixed text
* Supports custom prefix

> ### Type the variable to log

![demo](images/screenshot_inline_replace.gif)

> ### Log the variable on cursor

![demo](images/screenshot_log_cursor.gif)

> ### Type and log it as a string

![demo](images/screenshot_inline_string.gif)

> ### Keep your indents

![demo](images/screenshot_indent.gif)

> ### Use custom prefix

![demo](images/screenshot_custom_prefix.gif)

The fastest way to log your variables! Type it and press `Ctrl+Alt+W` + `W`.

Another way to `console.log` your variables is to simply place your **mouse cursor** on them and then wrap them on the line below with `Ctrl+Alt+W` + `Down` or the line above with `Ctrl+Alt+W` + `Up`.

Does the keyboard shortcuts seem to complex? Don't worry, they feel way more comfortable than they look. :)

Also, you are free to rebind all keyboard shortcuts as you want in your workspace and user settings files. :)

## Keyboard shortcuts

> ### Log as string
*Replace the word on your cursor or the selected text*

* `Alt+Shift+W` + `W`

##### OBS: If the string to log contains spaces you need to select the whole string

---

### Log on current line
*Replace the variable on the mouse cursor*
> ### Wrap and replace

* `Ctrl+Alt+W` + `W`

> ### With prefix

* `Ctrl+Alt+W` + `Ctrl+Alt+W`

> ### With prefix (show input box)

* `Ctrl+Shift+Alt+W` + `Ctrl+Shift+Alt+W`

---

### Insert **down**
*Insert console.log on the line below*

> ### Down

* `Ctrl+Alt+W` + `Down`

> ### With prefix

* `Ctrl+Alt+W` + `Ctrl+Alt+Down`

> ### With prefix (show input box)

* `Ctrl+Shift+Alt+W` + `Ctrl+Shift+Alt+Down`

---

### Insert **up**
*Insert console.log on the line above*

> ### Up

* `Ctrl+Alt+W` + `Up`

> ### With prefix

* `Ctrl+Alt+W` + `Ctrl+Alt+Up`

> ### With prefix (show input box)

* `Ctrl+Shift+Alt+W` + `Ctrl+Shift+Alt+Up`