Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 369
eye_mew Avatar asked Aug 11 '14 02:08

eye_mew


1 Answers

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

like image 57
sina72 Avatar answered Sep 29 '22 14:09

sina72