I’m using kate for few weeks now, on macOS, FreeBSD and Linux.
I don’t know if it’s just me (and my keyboard) but — in kate only — my home and end keys do not act as expected. They should allow me to jump to the first or last line of a document. Instead, either they do absolutely nothing or they only jump to start/end of current line.
Is there a way to get the classic behavior in kate?
Actually no, in all text editors I remember, the Home/End keys always mean start of a line or end of a line… it’s one reason I wouldn’t give those keys up when I bought a 75% keyboard…
Classic text editing shortcuts:
Action
Keyboard Shortcut
Go to start of current line
Home
Go to end of current line
End
Select from cursor to start of line
Shift + Home
Select from cursor to end of line
Shift + End
Go to start of document
Ctrl + Home
Go to end of document
Ctrl + End
Select to start of document
Ctrl + Shift + Home
Select to end of document
Ctrl + Shift + End
Move one word left
Ctrl + Left
Move one word right
Ctrl + Right
:—
:—
+ Select to beginning of word left
Ctrl + Shift + Left
+ Select to end of word right
Ctrl + Shift + Right
Cut selected text
Ctrl + X
Copy selected text
Ctrl + C
Please try these shortcuts in Firefox, or any other text environment and report back as to their effectiveness. They should work on this web page in Firefox… and they work really well when editing a post (like this one) in the discuss.kde.org website
I’ll be honest with you - I reckon this is a common confusion.
I think all apps don’t behave in the way you’d expect, logically I’d assume ‘Home/End’ would go to the start/end of a document, with modifiers to pin that down to lines/words etc.
Right, it’s understandable. For example, it wouldn’t have surprised me if you told me that MS Excel did that, but apparently it doesn’t.
So I wonder which apps actually do this!
Edit: ah, it seems to be a MacOS thing! It sounds like native Mac keyboards don’t have Home and End, but if you connect a standard keyboard to a Mac, Home and End get translated to the MacOS “start and end of document” shortcuts.
Apparently it’s most common with MacOS, and in ‘certain windows contexts’ like web browsers or document viewers.
I wish I had a VM to test it now…
Historical conventions: On Windows and Linux , the convention grew out of terminal and text‑editing environments where Home/End meant “jump to start/end of the line .” Document‑level navigation was added later via Ctrl + Home/End . This made sense in code editors and shells, where line navigation is far more common than jumping to the very top or bottom.
Ah yes - this seems to be the way MacOS works if you have a keyboard with Home / End keys. (See edit to my previous post.)
In browsers too, the behaviour is “go to start / end of document”. (I guess it’s rare to be horizontally scrolling inside a browser, so “go to start / end of line” isn’t that useful.) But that seems to be the same whichever OS you’re using.
while in an editor like kate use the ctrl modifier to go to the top or bottom of a document, and the alt modifier to to the to the top and bottom of your current screen view…. home/end are expected to just take you to the beginning or end of the current line.
while in a read only situation like a browser home/end will take you to the top and bottom of a a webpage
Some context even though the macOS specifics have been shared already: I’ve been a Mac user for decades, home/end to go to the top or to the bottom (of literally everything) is burnt in my muscle memory. Apple always included home/end keys on their «extended keyboards» (first one in 1987).
Everything works this way on macOS, except kate, I’m not aware of any other exception.
After a quick test on FreeBSD as a comparison, I’ve found that Firefox, fooyin, dolphin, tunar, behaves the same way (top/bottom), but kate, LibreOffice and the XFCE terminal are following the beginning/end-of-line model.
On macOS, LibreOffice behaves like any other app: top/bottom of document.
I’ve made an attempt to record a keyboard macro in kate, on macOS. Oddly, the «ctrl» key of my keyboard is recorded as «Meta» and the «Meta» key is recorded as «ctrl». IIRC this kind of things is caused by hard coded key codes inside the application.
Anyway, I really want to find a way to get in kate the top/bottom behavior. Any idea? Plugin?
if you open this webage in firefox and choose home/end from the keyboard it takes to top/bottom of the webpage.
if you then open the reply window and start typing, the home/end buttons will take you to the beginning/end of the line you are on in the editor.
libre office and kate are both editors so they operate on the beginning/end of the line assuming you are editing your content, not just reading it like a webpage.
you would use ctlr+home and ctrl+end in the editor window to go tot he top and bottom for the text box.
i’ve never noticed this to work in any other way, but then i don’t have occasion to use a mac for anything.
It’s something you don’t notice - it’s instinctive for most of u s.
There is a ‘Smart’ function in Kate (Settings/Editing) where you can set:
Normal behaviour - Home jumps to the beginning, then End to the very End
Smart behaviour means Home first jumps to the first non-whitespace character, a second press sends it to column 0. End jumps to the last non-whitespace character, and pressing again takes it right to the end (of trailing spaces or tabs).
‘Smart’ is actually very good.
int main() {
printf("Hello, world!");
Trying with this is interesting, something I didn’t really notice before.
Are you advocating that Kate’s behaviour should change specifically on MacOS (to match the OS norms), but remain as it is on FreeBSD and Linux (to match those OSes’ norms)?
My best expectation would be a tunable in kate’s config so that the user would be able to choose the preferred behavior (default to line-mode, option for document-mode).
I’m not using Linux much and I don’t plan to use it extensively in a foreseeable future. But I tend to use FreeBSD more, and I’ve managed to get about the same behavior for most features I use on an hourly basis. For example, on my mouse I’ve mapped 2 lateral buttons to copy and paste respectively, both on macOS and FreeBSD. I’m trying to make moving from one OS to the other as painless as possible (being over 50 means I’ve more than 35 years of habits and getting new ones requires a lot of work).
On macOS I’m trying to use kate more, but coming from BBEdit it’s not that easy (I lose a lot), and inside my text editor I rely heavily on home/end (document mode). I can lose that in LibreOffice, no big deal. But in my daily text editor that’s tough.
Haha playing the ‘curmudgeon’ card now. I’m 63 and had to adjust a couple of times to different operating systems over the years.
However, as I already framed it - the shortcuts I posted ARE the classic Windows/Linux conventions, and Ctrl home/end is document navigation.
MacOS is the outlier here, and BBEdit follows that convention.
So yes, your best expectation might come to fruit if you request/brainstorm an extra configuration option in Kate and grab the attention of a developer who might think it worth including a toggle (or at least look to see how complicated such a task might be):
Default (current line-based behaviour)
Optional toggle for MacOS users to switch Home/End into document-mode.
It might be possible to remap keys through your KDE Global shortcut system, and in Kate’s own shortcut settings.
Go to Shortcuts →Navigation
Reassign HOME to `Move to start of document’ and END to ‘Move to end of document’.
That would override the default line-based behaviour globally.
Inside Kate, you can configure shortcuts, search for ‘move to beginning/end of document’ and bind those actions directly.
This would bind those only in Kate (so not in kwrite, or other editors).
You can definitely change this behavior under “Settings” => “Keyboard Shortcuts”.
You will find kate already offers options for Line, Viewport and Document Versions of “Move to beginning/end”: