CotEditor icon indicating copy to clipboard operation
CotEditor copied to clipboard

Add 'Move to Begin of line' and 'Move to End of line' shortcuts

Open petergithubmgw opened this issue 1 year ago • 6 comments
trafficstars

Current issue

I'm always frustrated ... when I press Home or End keys when using CotEditor. If shortcuts for both begin and end of line were added, that wouldn't be an issue anymore.

The solution you'd like

Add to Preferences > Shortcuts > Edition an entry for Begin of line and another entry for End of line. Thanks.

Alternatives you've considered

Don't really want to use a 3rd party tool to remap keys if that behavior could be managed by CotEditor itself.

CotEditor version

4.8.7 (657)

macOS version

Sonoma 14.5

Additional context

No response

petergithubmgw avatar Jul 25 '24 09:07 petergithubmgw

Thank you for the request.

I have been thinking about customizing such implicit Emacs-style key bindings for a long time, but have yet to come up with a clean solution. Let me have more time.

1024jp avatar Jul 26 '24 07:07 1024jp

Perfect. Thank you.

petergithubmgw avatar Jul 27 '24 14:07 petergithubmgw

on mac os, traditionally you fix this in the ~/Library/KeyBindings/DefaultKeyBinding.dict which works for CotEditor

~/Library/KeyBindings/DefaultKeyBinding.dict

{
	"\UF729"    = "moveToBeginningOfLine:";                               /* home */
	"\UF72B"    = "moveToEndOfLine:";                                     /* end */

	"\UF72C"    = "pageUp:";                                              /* page-up */

	"\UF72D"    = "pageDown:";                                            /* page-down */
}

mccoma avatar Oct 23 '24 20:10 mccoma

It works!!!

Thanks a lot, mccoma.

on mac os, traditionally you fix this in the ~/Library/KeyBindings/DefaultKeyBinding.dict which works for CotEditor

~/Library/KeyBindings/DefaultKeyBinding.dict

{
	"\UF729"    = "moveToBeginningOfLine:";                               /* home */
	"\UF72B"    = "moveToEndOfLine:";                                     /* end */

	"\UF72C"    = "pageUp:";                                              /* page-up */

	"\UF72D"    = "pageDown:";                                            /* page-down */
}

petergithubmgw avatar Oct 29 '24 16:10 petergithubmgw

To give some references for other changes people make:

https://web.archive.org/web/20160314030051/http://osxnotes.net/keybindings.html

https://developer.apple.com/documentation/appkit/nsstandardkeybindingresponding?language=objc

hope this helps you go further

mccoma avatar Oct 29 '24 18:10 mccoma

Hi, I've also been looking forward to this feature for a long time.

Thanks @mccoma, for providing a great workaround.

johnny-the-coder avatar Jan 21 '25 09:01 johnny-the-coder