Bug 478511 - Switch to Tab per shortcut
Summary: Switch to Tab per shortcut
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: 24.05.1
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Lassi Väätämöinen
URL: https://invent.kde.org/utilities/kate...
Keywords:
: 481385 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-12-14 14:00 UTC by kde
Modified: 2024-08-04 18:00 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description kde 2023-12-14 14:00:43 UTC
SUMMARY

I would like to be able to switch to tabs directly instead of cycling through them. In programs like Firefox, this is possible via Alt+number, which is what I'd specifically set it to.
I'm aware this only works when you have 10 tabs or less, but I think usually you have less than that open at once.

It would accelerate my workflow a lot if I could switch between tabs without having to move my mouse or cycle through them until I find the right one.

Someone on reddit had the same idea, but didn't open a ticket for it as far as I can see: https://old.reddit.com/r/kde/comments/twn7yn/

SOFTWARE/OS VERSIONS
Arch Linux: 6.6.5-x64v1-xanmod1-1
KDE Frameworks Version: 5.112.0-1
Qt Version: 5.15.11+kde+r147-1
Sway: 1.8.1-4
Comment 1 Waqar Ahmed 2023-12-17 07:19:43 UTC
You can use Alt+left/right for quick nav between tabs
Comment 2 kde 2023-12-17 15:43:43 UTC
(In reply to Waqar Ahmed from comment #1)
> You can use Alt+left/right for quick nav between tabs

I'm aware. That's what I meant by "cycling between tabs". Read first, understand second, comment third. Using the arrow keys gets confusing and exhausting when you're used to jumping to tabs directly.
Comment 3 Waqar Ahmed 2023-12-17 16:22:21 UTC
It was a suggestion. No need to get snarky.
Comment 4 Lassi Väätämöinen 2024-06-26 19:40:08 UTC
(In reply to kde from comment #2)
> I'm aware. That's what I meant by "cycling between tabs". Read first,
> understand second, comment third. Using the arrow keys gets confusing and
> exhausting when you're used to jumping to tabs directly.



How about using the Ctrl+Alt+O quick open? It lists the open tabs first, you enter enough letters to make it unique. Enter. And you're in the tab.
Comment 5 kde 2024-06-27 17:26:17 UTC
(In reply to Lassi Väätämöinen from comment #4)
> (In reply to kde from comment #2)
> > I'm aware. That's what I meant by "cycling between tabs". Read first,
> > understand second, comment third. Using the arrow keys gets confusing and
> > exhausting when you're used to jumping to tabs directly.
> 
> 
> 
> How about using the Ctrl+Alt+O quick open? It lists the open tabs first, you
> enter enough letters to make it unique. Enter. And you're in the tab.

"oh, this feature doesn't exist? how about you try this other thing?"
how about no?

Ctrl+Alt+O is even worse than cycling through tabs because I have to search for the tabs by filename, adding several keystrokes.

This is not about being able to switch tabs with the keyboard at all, but adding a way of switching tabs that's pretty standard, not currently set to anything else in kate, most efficient if you're used to it (*one* shortcut) and ingrained in my muscle memory to the point where I accidentally try to use it in kate, despite it not working, getting annoyed and using alt-arrows instead, which, by the way, is most often used as forward/back in programs with histories, causing me to also accidentally go back a page in firefox occasionally. I've lost paragraphs of text this way >:/

Also, to mention this, sometimes I also switch between two of the same tabs quite often, meaning I currently first have to put them next to each other before I can do that instantly to compare contents or whatever. I'm sure there's a split view somewhere but that doesn't fit into my current workflow and I'd rather not add more complexity to it.

In any case, point being, it would rid kate of the biggest annoyance I have with it if this feature was implemented. simply Alt+Nr to switch tabs, how hard can that be to implement?
Comment 6 Lassi Väätämöinen 2024-06-27 17:35:47 UTC
(In reply to kde from comment #5)
> "oh, this feature doesn't exist? how about you try this other thing?"
> how about no?
> 

How about it you tone it down, take a breath and chill. It's not that serious.


> Ctrl+Alt+O is even worse than cycling through tabs because I have to search
> for the tabs by filename, adding several keystrokes.
> 
> This is not about being able to switch tabs with the keyboard at all, but
> adding a way of switching tabs that's pretty standard,

Any other examples of text editors that do this as standard? 

> anything else in kate, most efficient if you're used to it (*one* shortcut)
> and ingrained in my muscle memory to the point where I accidentally try to
> use it in kate, despite it not working, getting annoyed and using alt-arrows
> instead, which, by the way, is most often used as forward/back in programs
> with histories, causing me to also accidentally go back a page in firefox
> occasionally. I've lost paragraphs of text this way >:/
> 
> Also, to mention this, sometimes I also switch between two of the same tabs
> quite often, meaning I currently first have to put them next to each other
> before I can do that instantly to compare contents or whatever. 

This you can do ctrl-tab, since you are switching between two latest tabs.

> In any case, point being, it would rid kate of the biggest annoyance I have
> with it if this feature was implemented.

Well, to be honest, this is just one user wishlist request. As far as I have understood, in general in opensource projects, you could get stuff implememted if a) you get enough users to back your idea up; b) it is a "killer" feature that would convince developers to do that.

> simply Alt+Nr to switch tabs, howhard can that be to implement?

Not sure, but I suppose your contribution in form of code would be as valuable as anyone elses?
Comment 7 Lassi Väätämöinen 2024-06-27 17:41:30 UTC
Konsole has separate shortcuts: "Switch to tab #X". So you can assign any shortcut, not bound by numbers. Perhaps similar shorcuts could be implemented for Kate.
Comment 8 Lassi Väätämöinen 2024-06-27 17:50:18 UTC
> currently first have to put them next to each other before I can do that instantly to compare contents or whatever. 

Also, there are better, convenient and faster tools for comparing changes between two documents, e.g., 'diff' and its graphical relatives.. Your approach does indeed sound stressful, to be honest.
Comment 9 kde 2024-06-27 19:05:15 UTC
(In reply to Lassi Väätämöinen from comment #6)

Some quotes reduced for brevity. this is longer than intended, sorry for that

> How about it you tone it down, take a breath and chill. It's not that serious.

I'm quite sick of developers going "hey, how about you try this other thing that isn't what you wanted". This here is far from the only time I've seen this sentiment and it's quite frustrating.

> Any other examples of text editors that do this as standard? 

- gedit
- ghex
- Windows 11 notepad (with ctrl, possibly reconfigurable idk)
- notepad++ (Ctrl+numpad, but reconfigurable to alt+normal numbers)
- vscode
- zed
- xed
- sublime text
- geany
- bluefish
- lite XL

I've gone through some "top 10 linux editors" to get more data. Almost everything I was able to install supported this, with only some very niche projects falling out of line. …and notepadqq, to be fair.

Note: KDevelop, unlike kate, does not interpret alt+number as text input (except for alt+0 for some reason), making me think it's bound to *something*, but idk what it is

> This you can do ctrl-tab, since you are switching between two latest tabs.

This works in Kdevelop, but not in Kate, as far as I can see.

> Well, to be honest, this is just one user wishlist request.

…I know. I'm not expecting KDE to jump up and immediately implement it just for me. My exacerbation is purely because people keep suggesting things that miss the point entirely and assume I haven't tried finding alternative ways of using it.

> Not sure, but I suppose your contribution in form of code would be as valuable as anyone elses?

My experience contributing to large projects hasn't been good, so I'm kind of hesitant on that. I have more urgent contributions to make, in any case… Understanding an existing codebase, especially one as large as kate (+kwrite+kdevelop, which I think are built on the same base?) takes a lot of time.

> Konsole has separate shortcuts: "Switch to tab #X".

yes, that would be the optimal solution. That's generally how most configurable software implements it (not firefox, fwiw)

> Also, there are better, convenient and faster tools for comparing changes between two documents, e.g., 'diff'

I meant more for code deduplication (…and deliberate duplication, when necessary) and such. I use diffs where applicable.
Comment 10 Lassi Väätämöinen 2024-06-27 19:09:21 UTC
(In reply to kde from comment #9)
> (In reply to Lassi Väätämöinen from comment #6)
> 
> > This you can do ctrl-tab, since you are switching between two latest tabs.
> 
> This works in Kdevelop, but not in Kate, as far as I can see.
> 

I am using alt-tab  all the time, and did check that it still works before writing my previous comment. And to make sure I am not talking BS, I just checked again.
Comment 11 kde 2024-06-27 19:20:28 UTC
(In reply to Lassi Väätämöinen from comment #10)

> I am using alt-tab  all the time, and did check that it still works before
> writing my previous comment. And to make sure I am not talking BS, I just
> checked again.

idk what to tell you, I double-triple checked myself, Ctrl+tab does do that in KDevelop, and Kate just does not even have the same thing ("last used views") in the shortcut picker. Ctrl+tab in kate hides and shows tabs for me.

As for alt+tab (not sure if you typed the wrong thing in #10 or #6), that's not bound in either program.

My gf suggested it might be related to me not being on KDE, while you presumably are. I… guess that could be the reason…? idk.

If it's caused by a version mismatch: I'm currently on kate-24.05.1.
Comment 12 Lassi Väätämöinen 2024-06-27 22:01:11 UTC
Since I had too much spare time on my hands, I played around with it for a while, and now I have some sorf of proof-of-concept implementation for this.

Ugly as it can be, and need to figure out how to possibly make a MR out of this.
Comment 13 Christoph Cullmann 2024-06-27 22:16:53 UTC
I would be happy to review that and help to get it in shape.
Comment 14 Lassi Väätämöinen 2024-06-27 22:27:29 UTC
(In reply to Christoph Cullmann from comment #13)
> I would be happy to review that and help to get it in shape.

Here's my draft: https://invent.kde.org/utilities/kate/-/merge_requests/1527
Comment 15 Christoph Cullmann 2024-08-04 18:00:37 UTC
*** Bug 481385 has been marked as a duplicate of this bug. ***