I want to be able to insert import ipdb; pdb.set_trace() on the line below where I am on a key press. For obvious reasons ;-)
Two fairly easy ways to do this:
Create a snippet... go to Tools>Developer>New snippet, bung this in:
<snippet>
<content><![CDATA[import ipdb; pdb.set_trace()]]></content>
<tabTrigger>p</tabTrigger>
</snippet>
save it.. should start working straight away.
4 key strokes.
OR
You could use the macro tool:
Now save your_macro.sublime-macro (Tools>Save macro), and add this key binding to your user key bindings:
{ "keys": ["p"], "command": "run_macro_file",
"args": {"file": "Packages/User/your_macro.sublime-macro"} }
now 'p' will insert your text, on the next line..
1 key stroke... but you must be careful to write code that never needs the letter p... ;)
On Mac OS X I have to save it with extension:
.sublime-snippet
to get it working.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With