Bug 411126 - Feature Request Kate - Text manipulation
Summary: Feature Request Kate - Text manipulation
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: 19.04.3
Platform: Kubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-08-21 04:42 UTC by Scott
Modified: 2019-08-23 02:48 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Scott 2019-08-21 04:42:58 UTC
Feature Request

In Kate include sort function (ascending/descending) and remove duplicate entry and blank line function in the GUI.
Comment 1 Kåre Särs 2019-08-21 07:49:11 UTC
At least the sorting is already implemented :)

Tools -> Scripts -> Editing -> Sort Selected Text
Comment 2 Scott 2019-08-21 11:34:46 UTC
Didn't even see that sort menu item but it does not give the ascending/descending option. In light of the frequency that I imagine sorting attracts maybe it can be given it's own button on the top line of the GUI?
Comment 3 Dominik Haumann 2019-08-21 17:24:25 UTC
There are already two way to get what you want:
1. The Text Filter plugin
2. The scripts in the command line

1. Text Filter Plugin
Once enabled in Kate (via Settings, Plugins), you can invoke Tools > Filter Through Command (Ctrl+\), then a dialog appears. Type: sort | uniq | tac <enter>
Then, you get exactly what you are asking for.

2. Command line (F7)
Select text, hit F7, then type sort, F7 again, type uniq. Unfortunately, 'tac' is missing, so you only get almost what you want. If that is not good enough, you can always script such actions yourself:
https://docs.kde.org/stable5/en/applications/katepart/dev-scripting.html
You can essentially write any text manipulation part in JavaScript.

For now, I'll close this. If this is not good enough or you need further help, let's continue the discussion here :-)
Comment 4 Scott 2019-08-22 04:29:59 UTC
Thanks Dominik, 

here goes.

I suppose it's a different philosophy. Having to type in anything to sort a list alphabetically, up or down, is in my opinion, a decade behind the ball.

I use data lists with around 300k lines which causes issues with some editors but causes no problems with Kate so I know it's a solid performer at it's core. I was/am aware that I could sort entries using the keyboard but that is not what I want or need. The analogy here is clear, I do not want to wind up the motor to start my Model T, I want to turn a key or push a button.

On a macro level Ubuntu/Linux has squandered years chasing rainbows and hoping for the world to gravitate back to the keyboard, which is never going to happen, and in the last 2 years it appears they have seen the light- the overwhelming majority of the population do not have the knowledge, time or inclination to use text based interfaces on a computer, resulting in flatpacks, snaps and appimages. Argueing against this is akin to argueing against gay rights - the world has moved on, gay rights and GUIs are now the norm.

On a micro level of just myself, I am hopeful that many more people switch to Linux and I know that the most important group of people to capture are those who could probably be best described as semi literate computer people, people without formal computer skills training but can find their way around computers with a large degree of autonomy, for example, being able to do some basic scripting. This group will largely expect that the simple chores of computer life will have all been sorted before they decide to devote time and energy to it.

My decision is to choose between using Kate and using Editpad in Wine. I need sorting and I want one click to do it. Yes, it's these little things that decide who buys what product. Imagine trying to sell me (assume petrol head) a model T that accelerated faster than a Ferrari, cornered better and had a higher top speed but had no electric starter. So I thought I would put in a feature request that sways the balance Kate's way because it does not matter to me how fast your Ferrari goes if I have to wind it up to start it.
Comment 5 Dominik Haumann 2019-08-22 17:53:02 UTC
So you are missing:
- Sort descending
- Unique

Anything else?
Comment 6 Scott 2019-08-23 02:48:22 UTC
Lol, this is almost surreal, almost like time warping back 4 or 5 decades to school. Delete duplicates please.

Thanks.