Hacker News new | ask | show | jobs
by Elrac 3561 days ago
I'm a bit hesitant to burden you with feature suggestions - sidetracking the developer(s) can easily kill many small projects. But I'd like to mention a feature I would find compellingly useful that I have yet to see in "modern" editors. Possibly this could be a distinguishing feature that gives you a niche!

IBM's mainframe editor ISPF allowed you to select a set of lines, usually based on a search (including negative search, i.e. lines _not_ containing the search data), then to manipulate the set of lines thus selected (manually removing lines, adding lines or reversing the selection) and then performing other operations, such as global search and replace, or sorting, or indenting or whatever, on that set of lines while ignoring all other text in the file.

I occasionally run into tasks where I would love to have this functionality available.

2 comments

These operations are already supported by using structural regular expressions. As an example

    x g/foo
will select all lines containing foo. Similarly

    x v/foo
will select all lines not containing foo. Sorting etc. is taken care of by piping text through external tools.

I was more interested in common editing tasks for huge files which according to this thread a lot of people perform using sublime text.

ST can do all these things. Search by regex, the "Find All" command inserts a cursor selecting each result, then you can do all the usual text editing operations on each selection in parallel. It has sorting and the like built in, and you can do regex find and replace inside the selections, etc.