As I use Notepad++ daily at work, I want to extend it to be more productive.
What i want to do is select multiple lines containing words, right click and click a menu item like "Comma separate" then get all words on a single line comma separated.
I know that Notepad++ has support for macros and plugins. What would be the best way to do this?
I've got limited C++ skills.
Update:
To clarify, it's never more than 5 or 6 lines of words i need to re-format. The problem is that I do this like 50 times a day, so a way to speed up this would be great. Is there any other application that can do this for me?
Update2
Thanks for your answers. I'm going to try creating a Notepad++ plugin.
Update3
Does anyone know of a .NET-wrapper to create a Notepad++ plugin? Maybe this should be a new question.
I often use Notepad++'s macro function for things like this.
Eg. Say you have this:
apple
pear
banana
grape
orange
To comma separate lines, you could go to the first line, press ctrl+r (start recording), then end, delete, comma, then ctrl+r again to stop recording.
Then press control+p (play recording) repeatedly until you have what you want. If I'm processing a large file, I just hold it down, then ctrl+z my way back if I go too far.
You can't save your macro for later, but something that simple is easy to do again.
Edit: Actually, it turns out you can save your macro for later, and even assign a hotkey to it. Just record the macro, then go Macro -> Save current recorded macro
.
You can do this easily now with the Python Scripting plugin for Notepad++.
Just add a script with something like
text = editor.getSelText()
text = text.replace(' ', ',')
editor.replaceSel(text)
Assign the script a shortcut or toolbar button and you're away. I'm not totally clear on what you want to replace, but obviously changing the logic of the script should be pretty easy.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With