Can I enable Control-B/F cursor movement commands?

I’m on macOS, and in most text editors Control-B and Control-F move the cursor left and right, like the arrow keys. But they don’t work in LibreOffice. Is there a way to enable these shortcuts? The advantage over using the arrow keys is that I don’t have to leave the “home” touch typing position, so for me it is more ergonomic. They are also ingrained in muscle memory so I keep typing “b” or “f” by accident.

Other similar cursor movement commands do work in LibreOffice: Control P,N (for up and down by line), and Control A, E for moving on beginning or end of the line.

Ctrl-B is a direct formatting commad (Bold) on my LO running on Windows. And the Ctrl-F will activate the Find function.
But you can reassign the hotkeys with the existing features, and with user defined macros. Use the Customize function, and make a macro if it is required.
Here is a recorded macro:

sub GoRight
rem ----------------------------------------------------------------------
rem define variables
dim document   as object
dim dispatcher as object
rem ----------------------------------------------------------------------
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(1) as new com.sun.star.beans.PropertyValue
args1(0).Name = "Count"
args1(0).Value = 1
args1(1).Name = "Select"
args1(1).Value = false

dispatcher.executeDispatch(document, ".uno:GoRight", "", 0, args1())


end sub
1 Like

Thanks, the menu item “Tools > Customize …” got me there. It pops up a dialog and I was able to do it without writing a macro. It’s not the most obvious UI, but it let me bind Cntl-B and Cntl-F as desired, to functions to move back or forward by a character.

On macOS those formatting commands you mention are bound to ⌘B and ⌘F (ie, the “command” key not the “control” key).

Rob