I’ve been using WebStorm as my default code editor for the last 3 years, and it’s amazing. I think you do have one of your own. But do you know how you can boost your speed as a developer with it? If not, let’s do this. fast; it will take just a couple of minutes, I promise.
Live templates
How many times have you created a new file with the same structure? If it happens more than twice, Huston, you know the drill. As developers, we shouldn’t repeat ourselves, remember? For that, you can use Live Templates (aka Snippets). I’m sure you've seen it before but haven’t used it.
There are a lot of pre-built live templates that come with the plugins you install. Go to Preferences->Editor->Live Templates
And what is great about it is that you can create your own live templates and never repeat yourself again. To do so, just click the “+” button and paste your template, providing an abbreviation for it. For 3 years, I’ve created around 50 most-used abbreviations for React, React Native, Node.js, Next.js, and other projects I’m working on most of the time.
If you want to dive deeper into Live Templates, please go to the official documentation
Macros
How many steps would you need to make to create a file in the root folder of your project or in the "components" folder when bootstrapping your project?
Find a folder
Call the context menu
Click create a new file
Name it
Even with the terminal way, you would need to:
Open the terminal
Move to the folder
Create a file with a name
But we can do it faster with Macroses. It gives you control over repetitive tasks. You just create a record, edit and play back macros, assign a shortcut to them, and share them.
Record a macro
Open the Edit menu, point to Macros, and click Start Macro Recording.
Perform necessary actions that you want to be recorded.
Press 🟥 or select Edit -> Macros -> Stop Macro Recording.
In the Enter Macro Name dialog, specify the name for the new macro and click OK.
If the macro is intended for temporary use only, you can leave the name blank.
It’s easy to use when you know how it works. Stop reading for a moment and consider three ways you can use Macroses in your current project. Dive deeper into the official documents.
Keep It Simple
Just imagine how much time you will save by investing a few minutes in learning and setting up these tools, which you would use to focus more on the logic of your features instead of the routine things you repeat time after time. And it’s just the tip of the iceberg, so I encourage you to go further and find your own list of things you can automate, delegate to machines, or make in less time by applying a non-trivial approach.
I hope this article was useful. Please subscribe so you don't miss the next article, and feel free to contact me if you have any questions.
Top comments (0)