How to make Notepad++ do some automatic cleanup before saving certain files?
-
I write VHDL source code. To keep code clean, I need to remove trailing spaces and convert tabs to spaces just before I save the file. I then commit it into Git repository. I want that this be done automatically.
Either I can increase the functionality of the save feature or, create a keyboard shortcut that will do the above things and also save the file. How do I go about doing this automation for VHDL files ONLY?
-
@Hassan-Iqbal said in How to make Notepad++ do some automatic cleanup before saving certain files?:
remove trailing spaces and convert tabs to spaces
You can do this part with a macro.
I then commit it into Git repository. I want that this be done automatically.
From what I know, you have to have done a “git add” on the file, then you can do a “git commit”. These are command-line options, so you can set something up on the Run menu to do that, I suppose.
But, would you really want to commit each and every time you save? I wouldn’t. I’d want that to be more “controlled”, logically.
-
The Git stuff will happen outside Notepad++
The thing is, I want to automate only the things within Notepad++You are implying that I can assign the macro to a keyboard shortcut? But how to make sure that the macro stays there every time I open Notepad++ or restart the computer?
-
@Hassan-Iqbal said in How to make Notepad++ do some automatic cleanup before saving certain files?:
You are implying that I can assign the macro to a keyboard shortcut?
The macro menu contains the item Modify Shortcut/Delete Macro…, there you can assign a shortcut after you have recorded the macro.
But how to make sure that the macro stays there every time I open Notepad++ or restart the computer?
Because the macro is stored in a file called shortcuts.xml.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login