gedit

How to make Gedit run a custom command when I save a certain type of file?


For example, for source code files, I want gedit to lint it when I save it.

The "run lint" part is done, via the External Tools plugin. Now can I make it run automatically everytime I save a source code file?


Solution

  • You could save your file via your external tool running lint. There's a field Save with the following options: Nothing, Current document and All documents. Saving is done before the tool is run.

    Here's a screenshot:

    External Tools Manager (gedit)
    (source: gnome.org)