As a developer who's trying to level up my coding every day, I love finding little optimizations to increase my productive. This is a little gem that helps me out without thinking about it.
The Smart Semicolon extension for VS Code is just that... Smart.
All you do is press ;
and it adds a semicolon to the end of the line. Super simple, but super helpful for languages like PHP.
To prevent yourself from having to do a lot of cursor movements when typing an anonymous function, add the ;
before you break to a new line. You got what you need without having to move down a line and add it manually.
# Step 1 - Write an anonymous function
Route::get('foo', function() {|})
# Step 2 - Add the semicolon
Route::get('foo', function() {|});
# Step 3 - Press return
Route::get('foo', function() {
|
});
This seems obvious, but it took me way to long to figure out. When I moved to VS Code I couldn't find a quick way to do this. I tried using the Vim extension, an old macro extension that didn't work. So I thought I was stuck doing the annoyingly slow (arrow down, add semicolon, arrow up, tab) movements by hand everytime.
Do you have any optimizations that increase your productivity? I would love to hear about them. Tweet me.