Emacs key binds for cursor movement

Godot Version

v4.2.1.stable.official [b09f793f5]

Question

Text fields in macOS and other Unix-based systems usually allow for cursor movement using combinations such as ctrl+f/ctrl+b/ctrl+p/ctrl+n, etc.

How can I enable these key binds in the Godot code editor? It appears I can use ctrl+e and ctrl+a to go to the end or start of the line, but other key binds such as the ones listed above (or ctrl+k to erase starting from the cursor to the end of the line) are not available.

I wish I could be less vague but I am not sure what these bindings are called – I think they originate from Emacs?

All the input bindings are set in the project settings in the Input Map tab(enable Show built-in actions) anything else that’s not shown there you’ll need to implement yourself like ctrl+k

You could also open a proposal here Issues · godotengine/godot-proposals · GitHub to implement them in the engine directly.

I found the settings you are referring to but I must be missing something because modifying them does not seem to have any effect.

For example, I added Ctrl+P under ui_text_caret_up but the key bind does not move the cursor. Similarly, if I remove the Up mapping from ui_text_caret_up, the up arrow still moves the cursor up. I have a feeling these bindings only apply to in-game text fields (and not the Godot code editor itself)?

My bad, I thought you were talking about in-game LineEdits The editor shortcuts are in the editor settings Shortcuts tab.

In this case if you want to add new ones you’ll need to write a plugin Making plugins — Godot Engine (stable) documentation in English but it’s not going to be an easy thing.

1 Like

That’s exactly what I was looking for, thank you! I can do without the extra bindings for now.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.