KTextEditor: Tweak keyboard shortcuts to free F keys
ClosedPublic

Authored by gregormi on Dec 8 2018, 11:09 PM.

Details

Summary

The idea is to use F6 and Shift+F6 in Kate for Next and Previous Search
Match (see https://phabricator.kde.org/D17443). These shortcuts are also used by QtCreator for that.

Since F6 is currently used for "Show Icon Border", here is a proposal to
adapt.

  1. Change shortcut for "Show Icon Border" to "Ctrl+E, Ctrl+B" because it is used not that often to deserve an F key.

Why "Ctrl+E, ..."? Because Qt Creator uses it as start key combination for various functions. The alternative would be "Ctrl+D, ..." which is used by Visual Studio.

Ctrl+E is currently used for "Go to previous edit" (Ctrl+Shift+E: go to next edit). Ctrl+D is currently used to comment a line. I choose to change "Go to previous edit".

  1. Set new shortcut Alt+F6 and Alt+Shift+F6 for "Go to previous/next edit".

While at it, I made some additions with the newly freed Ctrl+E shortcut:

  1. Add Ctrl+E, Ctrl+W for "Dynamic Word Wrap" (like in Qt Creator) (the current F10 could be freed later)
  1. Use Ctrl+E, Ctrl+I for "Clean Indentation" which is a useful feature (which could later be extended by a more powerful code formatter)
  1. Use Ctrl+E, Ctrl+S for "Show non-printable spaces" (for comparison: in Qt Creator it is Ctrl+E, Ctrl+V for "Visualize Whitespace")
  1. Use Ctrl+E, Ctrl+L for "Show Line Numbers" (as alternative to F11 which could later be used for something else)

Diff Detail

Repository
R39 KTextEditor
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 5837
Build 5855: arc lint + arc unit
gregormi created this revision.Dec 8 2018, 11:09 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptDec 8 2018, 11:09 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
gregormi requested review of this revision.Dec 8 2018, 11:09 PM
gregormi edited the summary of this revision. (Show Details)Dec 8 2018, 11:14 PM
gregormi added a reviewer: Kate.
ngraham added a subscriber: ngraham.Dec 9 2018, 1:56 AM

I always re-bind Find Next and and Find Previous to use Ctrl+G and Ctrl++G. These are the shortcuts that are used by most 3rd-party apps, as well as all GNOME and macOS apps. It might make more sense to standardize on those.

I always re-bind Find Next and and Find Previous to use Ctrl+G and Ctrl++G. These are the shortcuts that are used by most 3rd-party apps, as well as all GNOME and macOS apps. It might make more sense to standardize on those.

Just to clarify: F3/Shift+F3 would stay the same, right?

F3: goto next match when searching in current file only
Shift+F3: goto previous match when searching in current file only

About Ctrl+G: The Ctrl+G suggestion (as alternative to F6) would apply to a project wide search. I also thought of F6 to later become the "universal next" which could also be used to step through code analyzer results.

Currently, Ctrl+G is bound to "Goto line" which is also common in other programs (Atom, Sublime, ...). An alternative for "Goto line" could be Ctrl+L as in Qt Creator.

I always re-bind Find Next and and Find Previous to use Ctrl+G and Ctrl++G. These are the shortcuts that are used by most 3rd-party apps, as well as all GNOME and macOS apps. It might make more sense to standardize on those.

Just to clarify: F3/Shift+F3 would stay the same, right?

Yeah, as backup/additional shortcuts so we don't break workflows for people who currently use them.

Currently, Ctrl+G is bound to "Goto line" which is also common in other programs (Atom, Sublime, ...). An alternative for "Goto line" could be Ctrl+L as in Qt Creator.

Yeah, Ctrl+L is the more common one used in other editors that I'm familiar with.

I always re-bind Find Next and and Find Previous to use Ctrl+G and Ctrl++G. These are the shortcuts that are used by most 3rd-party apps, as well as all GNOME and macOS apps. It might make more sense to standardize on those.

Just to clarify: F3/Shift+F3 would stay the same, right?

Yeah, as backup/additional shortcuts so we don't break workflows for people who currently use them.

This sounds that we speak of different actions here. This proposal does not touch the F3/Shift+F3 action which is "Next/Prev result" from a search that was started with Ctrl+F. It is not my intention to make changes there.
It is about introducing a default shortcut where we currently have none: "Goto Next/Prev result item" coming from a search across multiple files.

Oh!

Sorry, please ignore me...

Hm, these shortcuts exist for 15+ years... The extended shortcuts are not used widely in kde at all. Do we really address issues here?

Yes, those shortcuts exist long time. I would like to change them for these specific reasons which I think are worth to be considered:

  1. Introduce a default shortcut pair for "Next / Prev Match" which is useful and currently missing.
  1. "Free" some F keys to have them available for user-defined shortcuts; for me that would be those needed for developing (run, debug, stepping, stop and what else comes in handy; probably KDevelop would also profit to have F10 and F11 freed). I think it is easier for the user to choose one of the F keys for those actions than to find a free Ctrl+... combination. At least I have those problems regularly when trying to add useful custom shortcuts.

Extended shortcuts are often used in advanced editors and IDEs. I would be happy if there are other ideas that would address those issues.

I have no issues with freeing Fx keys.
But perhaps we should think about that then in a more extended way: Do we really need Fx shortcuts at all for showing the left border stuff?
People can add them and actually I would assume you once configure that and be done with it for the rest of your life.

With respect to bringing this https://phabricator.kde.org/T10279 forward, how should I proceed here? Can this go in as first step (after I removed F10 and F11)? (see also https://phabricator.kde.org/D17443)

src/view/kateview.cpp
700

todo: Remove F10

727

todo: remove F11

gregormi retitled this revision from KTextEditor: Tweak keyboard shortcuts to prepare for F6/Shift+F6 in Kate to KTextEditor: Tweak keyboard shortcuts to free F keys.Jan 12 2019, 11:33 PM
cullmann accepted this revision.Apr 22 2019, 4:37 PM

We go with the minimal invasive effort ATM: just remove F6.
As discussed in D17443.
We can introduce the CTRL-E... stuff later.

This revision is now accepted and ready to land.Apr 22 2019, 4:37 PM
This revision was automatically updated to reflect the committed changes.