If you write a lot of JavaScript this little Sublime Text Snippet might come in handy. It wraps your selection in a closure function and puts 2 cursors inside the parameter brackets.


Select some code and press Ctrl + Shift + P It will be listed in the fuzzy search with 'Snippet: Wrap in closure', so type something like sniw and you will find it. You can also type closure without any selection and it will generate an empty closure function.

Have fun and here's the link to the gist