We pretty much type everyday, every working hour. Let it be Excel, Word, Powerpoint, Visual Studio, HTML, or simply your Email. We code, we write articles, we write mails, we write scripts and so much we do with text. And then you stumble across certain tasks that is repetitive, and you wish if you could automate it so it gets done in a click, don’t you ?
So, sometimes you just wish you could type things faster, or at many places together, or copy one code element at 10 different places in one go, or things of similar sort. You might want to replace with one letter at multiple places, or just add some text before and after your 200 line code. You might thing this is do-able in excel, but do-able is just not enough anymore. You need to move to multi-editing !
Rejoice, your favorite editors Notepad++ and Sublime has this feature already. Let’s see how to do that in Notepad++.
Go to Settings – Preferences – Editing – Enable ‘Multi-Editing Settings checkbox’
Lets say you have your text like –
And you need it like –
The cost of abc is 123
The cost of def is 456
The cost of ghi is 789
Of course this is breeze in excel but we don’t prefer that since –
-Excel can bring in garbage values that can cause error in codes
-Creating that formula is tricky when you have characters like +=- etc
So how we do it in Notepad++ ? Lets see –
Once you have enabled multi-editing using above steps, simply place your cursor before abc in the first line, then hold Ctrl and click before ‘def’, and while you are holding Ctrl, click before ‘ghi’ also. You will see a cursor is blinking in front of each row.
Now, start typing. You will see that you are automatically typing at 3 places in one time.
Done. You have just achieved it in 5 seconds that would take a minute in Excel !
So if you are looking for ways of how to edit in Notepad++, or ways to use multi-editing, this is the way !
Also, Explore the Record Macro functionality that lets you do multiple things on a row and then repeat it over other lines in one click.
Here is how ->
- Place your cursor at the start of your text, click the ‘record’ button in the ribbon, and then edit just that one row of text. You may only use arrow keys or ctrl+arrow keys to move around characters/words rather than clicking with your mouse. The ‘home’ and ‘end’ keys are also useful.
- When you’re finished with that one line, move your cursor (again without using the mouse) to the start of the next line.
- Click the ‘stop recording’ button.
- Click the ‘play macro’ button to check that it works on the next line as expected.
- Click the ‘run macro multiple times’ to do it for all the lines of the code, and you would see the magic happening in seconds !
Play the video to understand how fast it is !
Watch this video tutorial to see how to do it. If you like the post and found it quite useful in your daily work, don’t forget to send me a comment.
Don’t you think it is much easier to work in Notepad++ and edit multiple words together, multiline find and replace, record macro and do tasks in seconds ? It indeed is !
If you are already not using it, use this link for our favorite Text Editor Download : https://notepad-plus-plus.org/
If you in any case need Notepad++ MSI, click https://sourceforge.net/projects/notepadmsi/
In case you are looking for Portable Notepad++, you can check out this link : https://portableapps.com/apps/development/notepadpp_portable
More Tips on Working in Notepad++
Notepad ++ Column Mode
In Notepad++, If you need to select text as though it was a column in Excel / spreadsheet, then you can do this using the following steps :
- Place your cursor at the beginning position where you want to begin selecting text.
- Press and hold the “Shift” and “Alt” keys on your keyboard.
- Continue holding “Shift” and “Alt”, press “Down” and then press “Right” arrow keys on your keyboard to select the text as desired.
Incase you wrote HTML code in Notepad++ and need to save your file in HTML format, it is as easy as saving your file in a different format. Just save your file and choose HTML from the ‘Save As Type’ dropdown :
Notepad ++ Shortcuts
If you are looking for Keyboard Shortcuts of Notepad++ then just click the link and you will Instantly get your FREE Pdf that has 101 Shortcuts while using Notepad++ Click here to get your Free Shortcuts PDF
Hope you enjoyed the video and the blog. Until next time, keep coding !