coteditor / CotEditor

Lightweight Plain-Text Editor for macOS
https://coteditor.com
Other
6.22k stars 424 forks source link

Pipe through command line #1564

Open timobezjak opened 6 months ago

timobezjak commented 6 months ago

Coming from TextMate, there’s a lot to love about CotEditor. And there is one thing missing: Pipe (selection or entire contents) through command line command. It adds a lot of power and saves you from reproducing all the sed, grep, and sort functionality for the few moments it’s needed. Actually, fgrep something | sort -u or egrep -v ^$ isn’t that rarely used, although the latter can be replaced by the regex search that is already available.

1024jp commented 6 months ago

I suppose the pipe feature is already implemented in the command-line tool.

Try running the following line in the terminal and you'll get a new document window with the text abc on CotEditor (you need to set the cot command first).

echo "abc" | cot -n

If you have a specific case that does not work, please elaborate on it more.

1024jp commented 6 months ago

I may have misread your request. Is it something similar to the previous requests #470 and #573? Then, I first recommend utilizing the CotEditor scripting feature to realize your demand with the current CotEditor. And for the GUI feature to quickly run some command-line commands, please be patient. I know the feature request is on the list but postponed for almost 10 years...

timobezjak commented 6 months ago

573 looks like it’s getting close. What’s missing is an option to give it a command line (instead of [ ] Delete matching lines and [ ] Grep and Find lines containing just let me typegrep -v). Thanks for considering the idea!