Hotkey changes?

3 views
Skip to first unread message

Phil Norman

unread,
Apr 12, 2024, 10:11:21 AM4/12/24
to evergre...@googlegroups.com
Hi.

I'm a bit bothered by the fact that while in Terminator one switches between tabs using alt + left/right arrow keys, in Evergreen the hotkey for changing workspaces involves square brackets (which seems to come from MacOS, and is a bit weird).

For consistency, and partly driven by the fact that I've recently switched to Sway (tiling window manager) and am using the keyboard for focus navigation more, I'd like to propose changing Evergreen's key bindings so that alt+left/right switches workspaces, and alt+up/down arrows changes focus between files within the current workspace. Probably just for Linux, though.

I'm also very tempted to add shift+ctrl+t, which should re-open the last closed file (something I keep trying to do but failing, due to brainwashing from Chrome).

Any objections? I could also refactor things so as to make the keyboard mappings configurable, but I suspect I might actually be the only person using Evergreen*.

Cheers,
Phil

* I did actually recently dabble in switching to vim, but was quickly reminded of just how much I hate vim for anything more complex than a 1-minute config file edit.

Elliott Hughes

unread,
May 4, 2024, 2:26:07 PM5/4/24
to evergre...@googlegroups.com
sadly i've literally [half] written more tty-based editors in the last few years than times i've started evergreen. i'm sure there's something interesting to be done in that space -- and have lots of prototypes of "what would the kind of gui editor everyone already knows how to use be like in a terminal?", for similar vim-hating-but-admit-it's-useful reasons[1] -- but i'm more of a polisher than anything else, so i get easily distracted by some minor point and so i have lots of interesting _pieces_ but no _whole_, and i still haven't poked at any of the "boring but you'll definitely want them" bits like undo. i wonder if i even did the original evergreen undo, or that was ed/you/mad?

anyway, i thought what we'd done with terminator and evergreen was that we basically _accepted_ any common key binding for a thing, but only _advertised_ one in the menu? or is that just terminator (which got a much more diverse pool of users than evergreen ever did)? anyway, i always thought that was a good idea. even perverts like mad can use their weird Windows[2] copy/paste keybindings (a) without having to think because they "just work" and (b) without the rest of us even having to know it's there :-)

iirc the model i had in mind for both was to be like the web browser. this is a trivial mapping for terminator where you have windows with tabs within them, and nothing smaller, but for evergreen your "windows" are actually tabs and your "tabs" are files within a tab.

but if alt-up/down (a) aren't used for anything already and (b) don't have _different_ precedent elsewhere, there's certainly a logic to them.

____
1. and wtf is nano's problem? it's a pretty sad indictment of the tty-based editor ecosystem when distros are switching _to_ that bizarre 1990s mess, even with its recent "modern" mode!
2. interestingly, i didn't realize until reading https://en.wikipedia.org/wiki/Cut,_copy,_and_paste just now that the "Windows" bindings are actually the CUA bindings, and the "standard" bindings are the Macintosh bindings. i genuinely believed that the now-standard bindings were the CUA bindings.

--
You received this message because you are subscribed to the Google Groups "evergreen-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to evergreen-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/evergreen-users/CAOa8eG7_WDjTDEboWfHyohdJ4_LYS8r8XsDeYdZ%2BeB%2B3RYE04w%40mail.gmail.com.


--

Phil Norman

unread,
May 5, 2024, 2:18:53 AM5/5/24
to evergre...@googlegroups.com
Hi.

Yep, I remember the "try to act like others" principle - there are even comments explaining such choices scattered around the code. The Evergreen key bindings seem to be set up to have _one_ hotkey per action though. On the 'be like a browser' front, I just noticed that alt+number switches to that numbered tab in both Evergreen and Terminator (as it does in Chrome).

I've also toyed with the idea of writing a new text editor, but mainly as a way of getting away from Java. Unfortunately Swing has been the only sane option for a GUI library until pretty recently (IIRC I looked at QT, but it was an absolute pain to even get started in). The last one I looked at was 'fyne' (a cross-platform GUI library for Go), which actually looks sort of sane. It didn't work under LWM, though (fyne apps crash on startup if some 3D extension feature isn't available - clever), but now that I've switched to using sway, I could try going down that route again.

The problem with writing a text editor is that there's a hell of a lot to do to replicate Evergreen's functionality. I started making a list at some point, which basically cancelled _that_ project :-)

Still, a new text editor written in Go would be rather nice. Particularly one which actually has unit tests.

The 'undo' feature is actually relatively easy if you design it into the text component at the start. If I remember correctly, we had quite a few bugs with the original Edit's undo/redo implementation, which is why I designed it into the PTextArea at the start. The undo buffer is a stack containing one object per edit (where an edit can be a single character addition/removal). It describes a position, set of characters to remove, and set of chars to add. It's completely bidirectional, so undo/redo becomes pretty easy. There's also the ability for 'compound' edits (search/replace), and for a before/after 'selection setter' so the caret/selection goes to where we expect - I think those were added later, probably not by me, but this was a long time ago and my memory is hazy.

One thing I'm really not that keen on is writing an editor which runs inside a terminal. It's kind of similar to an editor running inside a browser - you have yet another layer of abstraction to introduce lag, restrict what hotkeys you can use, and add bugs. BTW, I'd recommend reading the termcap/terminfo section of "the Unix Hater's Handbook". I found it quite eye-opening.

Anyway, I'll go ahead with the alt-arrow thing then. I'll also see if I can fix the shift+scroll horizontal scrolling in Terminator, which seems to throw some exception now.

Cheers,
Phil

Reply all
Reply to author
Forward
0 new messages