Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How to make Notepad++ do some automatic cleanup before saving certain files?

    General Discussion
    3
    4
    207
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Hassan Iqbal
      Hassan Iqbal last edited by

      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?

      Alan Kilborn 1 Reply Last reply Reply Quote 0
      • Alan Kilborn
        Alan Kilborn @Hassan Iqbal last edited by

        @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.

        1 Reply Last reply Reply Quote 5
        • Hassan Iqbal
          Hassan Iqbal last edited by

          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?

          Ekopalypse 1 Reply Last reply Reply Quote 0
          • Ekopalypse
            Ekopalypse @Hassan Iqbal last edited by

            @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.

            1 Reply Last reply Reply Quote 4
            • First post
              Last post
            Copyright © 2014 NodeBB Forums | Contributors