Sublime Forum

[SOLVED] Add shortcut / insert debug syntax

#1

Hi

I often using syntax :
echo "<hr><h1>DEBUG</h1><pre>"; print_r($variable_to_debug); echo "</ pre>"; die();

So I would like to configure an shortcut in order to automatically insert this syntax?
how can I do it?

Best

0 Likes

#2

create a custom keybinding (take a look in the Preferences menu):

{ "keys": ["alt+'"], "command": "insert_snippet", "args": { "contents": "echo \"<hr /><h1>DEBUG</h1><pre>\";\nprint_r(${0:\\$variable_to_debug});\necho \"</pre>\";\ndie();\n" }}

here I have used alt+ as an example

2 Likes

#3

Thanks!

Perfect!

0 Likes