Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Print ItNew to Visual Studio Code? Get it now.
Print It

Print It

Brian Malehorn

|
22,857 installs
| (2) | Free
Wrap a print statment around current word or selection
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

VSCode Print It

version number install count

Add print statements in one keystroke!

⌥ [, Alt [: wrap print statement

Demo

demo

Supported Languages

language example
JavaScript console.log("variable", variable);
TypeScript console.log("variable", variable);
React console.log("variable", variable);
Vue console.log("variable", variable);
HTML console.log("variable", variable);
Python print("variable", variable)
Go fmt.Printf("variable %#v\n", variable)
Ruby pp('variable', variable)
Java System.out.format("variable %s\n", variable);
PHP echo "\$variable "; print_r($variable); echo "\n";
C# Console.WriteLine("variable {0}", variable);
C++ std::cout << "variable " << variable << std::endl;
Rust println!(\"variable {:?}\", raw);
Dart print("variable = ${variable}");
Kotlin System.out.format("variable %s\n", variable)
Elixir IO.puts "variable " <> inspect(variable)
Bash echo "variable $variable"
Fish echo "variable $variable"

Templating

Want to change the default formatting? Set the configuration option print-it.[language].template:

  "print-it.javascriptreact.template": "console.log(\"The value of {{escaped}} is:\", {{raw}});"

This will make new print statements look like this:

console.log("The value of variable is:", variable);

A full list of supported options is available under the "Contributions" tab.

The following variables are available:

variable example exaplanation
{{raw}} "hello " + name the current selection, or current word
{{escaped}} \"hello \" + name raw, but escaped for use in a string

For all other languages, you can set the value of print-it.default.template:

  "print-it.default.template": "printf(\"{{escaped}} %s\\n\", {{raw}});"

Related Projects

  • Wrap Console Log Simple
  • Wrap Console Log
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft