Bug 451431 - Provide basic Text Editing Options via GUI/Plugins
Summary: Provide basic Text Editing Options via GUI/Plugins
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-03-12 17:06 UTC by rbharathkumar
Modified: 2024-08-24 08:14 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
notepad_plus_plus - Line Operations Options (107.74 KB, image/jpeg)
2022-03-24 12:39 UTC, rbharathkumar
Details
notepad_plus_plus_trim_options (32.75 KB, image/jpeg)
2022-03-24 12:41 UTC, rbharathkumar
Details
notepad_plus_plus_matched_count_search_mode (48.34 KB, image/jpeg)
2022-03-24 12:42 UTC, rbharathkumar
Details
kate - tools - scripts - editing (61.36 KB, image/jpeg)
2022-03-24 12:42 UTC, rbharathkumar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rbharathkumar 2022-03-12 17:06:49 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***


STEPS TO REPRODUCE
1. Open a text document with Kate
2. Try performing below text editing options via GUI. 
2.1. Sorting (Asc and Desc - As a number or text or decimal or time)
2.2. Removing duplicates
2.3. Removing Blank Lines
2.4. Removing Leading and Trailing Spaces (Combined or each one separately)
2.5. Count number of occurrences of a character.
2.6. Replace characters just by supplying the escape sequences e.g. \n, \t, \r instead of their regex equivalents.

OBSERVED RESULT
Currently no GUI options available. 

EXPECTED RESULT
It is possible to do all of them them via an option that allows use of commands on the file (filter ?) or through regex, but it would be much easier for less technical users to do the same if a easily available GUI option were available.
It would be ok even if these functionalities are all available as a single Text editing tools plugin so that users who don't need them or can get around using other options need not use them.

SOFTWARE/OS VERSIONS
Windows: Windows 10
macOS: 
Linux/KDE Plasma: Arch KDE (I use Kate both on my Windows and Arch Machines)
(available in About System)
KDE Plasma Version: 
KDE Frameworks Version: 
Qt Version: 

ADDITIONAL INFORMATION
Was stunned when introduced to such features in Notepad++, but it is disrupting my workflow of using Kate on both environments.
Comment 1 Waqar Ahmed 2022-03-23 14:09:42 UTC
Hi, 

these options are already available. Check the "Edit" menu and the "Tools->Scripts" menu. The menu actions can be assigned shortcuts or they can be added to the toolbar for quick access. They can also be executed via the command bar (Ctrl + Alt + I).
Comment 2 rbharathkumar 2022-03-24 12:39:42 UTC
Created attachment 147700 [details]
notepad_plus_plus - Line Operations Options
Comment 3 rbharathkumar 2022-03-24 12:41:44 UTC
Created attachment 147701 [details]
notepad_plus_plus_trim_options
Comment 4 rbharathkumar 2022-03-24 12:42:15 UTC
Created attachment 147702 [details]
notepad_plus_plus_matched_count_search_mode
Comment 5 rbharathkumar 2022-03-24 12:42:42 UTC
Created attachment 147703 [details]
kate - tools - scripts - editing
Comment 6 rbharathkumar 2022-03-24 12:44:16 UTC
(In reply to Waqar Ahmed from comment #1)
> Hi, 
> 
> these options are already available. Check the "Edit" menu and the
> "Tools->Scripts" menu. The menu actions can be assigned shortcuts or they
> can be added to the toolbar for quick access. They can also be executed via
> the command bar (Ctrl + Alt + I).

Hi,
Thank you very much for your response.
I did go through the options you had shared and found some of the options, but not all of them.
May be I am missing something ?

The following are some of the options I had mentioned in the issue initially.

2.1. Sorting (Asc and Desc - As a number or text or decimal or time) 
      --> Asc is available, but no descending option available or the ability to sort based on number or 
2.2. Removing duplicates
2.3. Removing Blank Lines
2.4. Removing Leading and Trailing Spaces (Combined or each one separately)
2.5. Count number of occurrences of a character.
2.6. Replace characters just by supplying the escape sequences e.g. \n, \t, \r instead of their regex equivalents.

Points 2.2 to 2.6 were not available as straight forward options but I do agree all of them are possible.
I have attached screenshots of the options available from notepad++ and from Kate as well just for reference.

I hope this does not come across as a demand for a feature, I am merely making a request.
I understand it is not possible to have all the features from a different tool in our tool.
So, if this is not something feasible or in line with Kate's roadmap or worth the effort, please feel free to close the request.

Thank you for all the hard work and contributions towards Kate and other KDE software.
Comment 7 Waqar Ahmed 2022-03-24 13:01:11 UTC
Hi,

Some more commands are available in the command line, see https://docs.kde.org/stable5/en/kate/katepart/advanced-editing-tools-commandline.html

more commands can be added via a javascript scrip, see https://docs.kde.org/stable5/en/kate/katepart/dev-scripting.html

We can expose more commands in the UI though. Some obvious are only available via the command line.
Comment 8 Waqar Ahmed 2022-03-24 13:02:00 UTC
For character/word count, the search and replace plugin will work.
Comment 9 Waqar Ahmed 2024-08-24 08:14:01 UTC
We have now exposed a lot more functionality in the Scripts -> Editing menu. Additionally its also available in the context menu.

If there is something else that's missing, please open a bug for that thing specifically.