Bug 489936

Summary: <Ctrl-[> (Control-Left Bracket) should behave as Escape in vi mode
Product: [Applications] kate Reporter: Tim Siegel <siegeltr>
Component: Vi Input ModeAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: ameyer0, christoph, waqar.17a
Priority: NOR    
Version First Reported In: 24.05.1   
Target Milestone: ---   
Platform: NixOS   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Tim Siegel 2024-07-08 16:12:28 UTC
SUMMARY

Typing <C-[> (^[, Ctrl-[, Control-Left Bracket) should behave as Escape in vi mode. In particular, it should enter Normal mode when in Insert mode. Other instances are less crucial, but should still behave as Escape for consistency.

STEPS TO REPRODUCE
1. Open Kate. Set Default Input Mode to VI Input Mode.
2. Type "ifoo" to enter insert mode and add "foo" to the buffer.
3. Type <Ctrl-[>, notice that nothing happens. Nothing is added to the buffer, and the editor remains in "VI: INSERT MODE".
4. Type <Escape>, notice that the editor switches to "VI: NORMAL MODE".

OBSERVED RESULT

Ctrl-[ does nothing

EXPECTED RESULT

Ctrl-[ behaves as Escape

SOFTWARE/OS VERSIONS
Operating System: NixOS 24.11
KDE Plasma Version: 6.1.1
KDE Frameworks Version: 6.3.0
Qt Version: 6.7.2
Kernel Version: 6.6.36 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800H with Radeon Graphics
Memory: 13.5 GiB of RAM
Graphics Processor: AMD Radeon Graphics

ADDITIONAL INFORMATION

This behavior is standard in the terminal since at least the late '80s (I don't know the full history). I searched for a similar bug report or discussion, but could not find any prior mentions of this problem.

Additionally, I could not figure out how to add a key mapping in Kate to accomplish this as a workaround.
Comment 1 Audrey Meyer 2024-07-19 22:02:14 UTC
It seems that this is already a feature but it's being superseded by a global shortcut.

WORKAROUND:
1. In System Settings, go to Keyboard->Shortcuts->Navigation.
2. Uncheck "Ctrl+[" under "Activate Previous Tab".
3. Restart Kate, Ctrl+[ should now work like escape in Vi input mode.
Comment 2 Waqar Ahmed 2024-10-16 19:06:21 UTC
Seems like Next tab/Prev Tab take up two shortcuts each!!! Thats a bit alarming for Kate as we are already running low on shortcuts and there's stuff overusing it :/

Anyways, that's a standard kde shortcut, unlikely that will change. Perhaps we should remove the fallback shortcut in Kate
Comment 3 Christoph Cullmann 2024-10-21 18:13:01 UTC
(In reply to Waqar Ahmed from comment #2)
> Anyways, that's a standard kde shortcut, unlikely that will change. Perhaps
> we should remove the fallback shortcut in Kate

Perhaps we should do that.
Comment 4 Waqar Ahmed 2024-10-22 04:08:08 UTC
Turns out its not 2 shortcuts, its at least 3:

QList(QKeySequence("Alt+Right"), 
QKeySequence("Forward")) 
QList(QKeySequence("Ctrl+PgDown"), 
QKeySequence("Ctrl+]"))
Comment 5 Christoph Cullmann 2024-10-24 16:53:28 UTC
Git commit eff9223a57704a16050b9bdcf52cfb24e98c87d8 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 24/10/2024 at 16:50.
Pushed by cullmann into branch 'master'.

Remove extra shortcuts for tab next/prev

M  +0    -2    apps/lib/katemainwindow.cpp

https://invent.kde.org/utilities/kate/-/commit/eff9223a57704a16050b9bdcf52cfb24e98c87d8