简体   繁体   English

退格到IntelliJ中的行首

[英]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 . 在OSX中几乎无处不在,使用命令 + Backward delete可以一直退回到行的开头。 I can't find a way to set up this behaviour within IntelliJ IDEA, and I find this very... 我找不到在IntelliJ IDEA中设置此行为的方法,我发现这非常......

...backward. ...向后。

Here are some basic keyboard shortcuts: 以下是一些基本的键盘快捷键:

  • Move Caret to Word Start: Ctrl + Left . 将插入符号移动到Word开始: Ctrl + 向左
  • Move Caret to Line Start: Home 将Caret移至Line Start: Home
  • Delete from Caret to Word Start: Ctrl + Backspace 从插入符号删除到Word开始: Ctrl + Backspace
  • Delete from Caret to Line Start: Shift + Home , Delete 从插入符号删除到行开始: Shift + Home删除

I assume you want to Delete from Caret to Line Start ("backspace to beginning of line"). 我假设您要从Caret删除到Line Start (“退格到行首”)。

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 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. 我测试了它,它工作正常。 为宏指定快捷方式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM