Let's say I have a block of text like My website iss https://www.example.com/123/456█
, where █
represents where my cursor is.
In vim
, I could just hit B
(as opposed to b
) to go back a WORD
(as opposed to a word
), getting me to My website iss █https://www.example.com/123/456
in one movement - where I can easily fix the typo in is
.
But in regular mac text boxes, there's no easy way to do this. I can move to the previous word
with Option
+ Left Arrow
. Doing this 6 times works:
https://www.example.com/123/456█
https://www.example.com/123/█456
https://www.example.com/█123/456
https://www.example.█com/123/456
https://www.█example.com/123/456
https://█www.example.com/123/456
█https://www.example.com/123/456
Or I can move the cursor to the beginning of the current line with Command
+ Left Arrow
. (And then move back to the right if I overshot). But neither are as good as being able to do what I want to do. Consider /
and .
as part of the "word" movement when doing option
+ arrow
.
Any recommendations?
zsh
with vim-like keybindings). I do NOT know how to do the movements I want in a regular text box, like, say, in slack or in a comment textbox in firefox while on stackexchange. – Ari Sweedler Apr 18 '23 at 18:20the Cocoa Text System
. It looks like there are a bunch of pre-baked commands, but not the one I am looking for. https://developers.apple.com/library/archive/documentation/Cocoa/Conceptual/EventOverview/TextDefaultsBindings/TextDefaultsBindings.html - another relevant link: https://apple.stackexchange.com/questions/16135/remap-home-and-end-to-beginning-and-end-of-line and https://ss64.com/osx/syntax-keybindings.html - which has a TON of stuff – Ari Sweedler Apr 19 '23 at 19:42keybindings.dict
are here: https://developer.apple.com/documentation/appkit/nsstandardkeybindingresponding?language=objc - and this is linked on thatss64
site. I will update here with my progress when I get through all of the reading I have to do! – Ari Sweedler Apr 19 '23 at 19:44