Search code examples
macosintellij-ideakeyboard-shortcutsbackspace

Backspace to beginning of line in IntelliJ


Pretty much everywhere in OSX, it's possible to backspace all the way to the beginning of a line using command+Backward delete. I can't find a way to set up this behaviour within IntelliJ IDEA, and I find this very...

...backward.


Solution

  • Here are some basic keyboard shortcuts:

    • Move Caret to Word Start: Ctrl+Left.
    • Move Caret to Line Start: Home
    • Delete from Caret to Word Start: Ctrl+Backspace
    • Delete from Caret to Line Start: Shift+Home, Delete

    I assume you want to Delete from Caret to Line Start ("backspace to beginning of line").

    If you want to execute this action with a single key, simply record a macro and assign a keyboard shortcut for it.

    • Menu -> Macros -> Start Macro Recording
    • Press Shift+Home
    • Press Delete
    • Menu -> Macros -> Stop Macro Recording
    • Assign a name, for example "Delete to Line Start"
    • Assign a shortcut to your macro: Menu -> File -> Settings -> Keymap

    Here's a screenshot of the settings dialog. I tested it and it works fine. Assign a shortcut to your macro