Powerful Web Development Tips and Tricks
We learn a lot of new things every day. Here I add some of the tips and tricks that I myself use on a regular basis.
Edit your last commit:
git commit --amend to edit your last comment. It opens your last commit in a text editor in the console itself. You can edit the comment and save.
How to use autocomplete in a terminal?
Your terminal already have an autocomplete feature. You can get autocomplete suggestions for commands, folder/file names. etc.
Start typing initial characters for your command and then press tab, If there are multiple options available, your terminal will give you multiple options to choose from. Or if there is only one option it will be chosen as default command.
If you press tab on an empty terminal, it will give you list of all the commands that you can run.
Replace all occurrences of a string
const str = 'let me find a and replace a with b' str1.replace(/a/g, 'b')
// "let me find b bnd replbce b with b"