unixwork / xnedit

A fast and classic X11 text editor, based on NEdit, with full unicode support and antialiased text rendering.
Other
83 stars 11 forks source link

Apply filter when loading and saving files with a given extension #114

Closed cblc closed 5 months ago

cblc commented 1 year ago

I don't know if this feature could already be added with the current macro/shell system in XNEdit. What I'd like to do is to invoke a shell command as a filter when the file being opened ends with a given extension, and also invoke another filter (symmetric but with potentially a different command name) when the file is saved with that extension.

My purpose in this moment is because I'm working with some xz-compressed files, but I foresee other possible uses (even perhaps being able to use XNEdit as a rudimentary hex-editor, although maybe that's too crazy 🤣

unixwork commented 1 year ago

Interesting idea. I think it is not possible currently with macros. Also integration into the open/save file dialog would be needed.

unixwork commented 5 months ago

I merged a new feature into master, that allows you to run filter commands when opening/saving files.

Filters can be configured in Preferences -> Default Settings -> Filters. There are predefined filters for gzip/bzip2.

cblc commented 5 months ago

Thank you very much!! I will build it this week. BTW, XNEdit has become now the only code editor I use in my Macs now. About 20 years ago, I used NEdit in SGI IRIX as my text editor, and then when my main system became OSX, I built NEdit on it, but, with the years, I moved to TextWrangler (NEdit was becoming more and more limited with the years). But now XNEdit has made it possible to go back, and it's the only editor I use. Thanks a lot!!

cblc commented 5 months ago

I think I'll mark this as complete, and if I have anything to add, I'll reopen it.