简体   繁体   中英

IntelliJ IDEA (Linux): Go to beginning/end of line

I have switched from OS X to Linux, and trying to get used to the different keyboard shortcuts in IDEA. One very important thing I cannot find is "move cursor to beginning/end of line" (Cmd-Left and Cmd-Right on OS X). Also looking at the reference card doesn't reveal anything useful.

我不熟悉 IntelliJ,但在大多数编辑器中,您可以简单地使用“主页”和“结束”按钮。

If anyone else is wondering this 2 1/5+ years after it was answered like I was, you have to hit Fn + either left or right arrows.

I just switched to Ubuntu and relied HEAVILY on the command button and its killing me now that everything is so different.

对我来说,在 Ubuntu 上,移动到行首和行尾是 Fn+Home,Fn+End。

I reinstalled my IntelliJ and since IdeaVIM plugin was not installed I decide to just google how to do that with IntelliJ defaults and I gotta tell ya... Fn+Home/Fn+Arrow is not convenient in a slightest

Two possible answers:

  1. Install the IdeaVIM plugin (You should not do that if you are not familiar with VIM)

  2. Remap those keys to something that is easier to access

You can go to the beginning or end of the line using Home and End . But I set some shortcuts for these actions.

First, go to Settings > Keymap

Search one of the following in the search box and set a shortcut for it. For example, I used these shortcuts:

  • Move Caret to Line End Alt + L
  • Move Caret to Line Start Alt + J

Additional shortcuts:

  • Move Caret to Link End with Selection Alt + Shift + L
  • Move Caret to Link Start with Selection Alt + Shift + J
  • Add Selection for Next Occurrence Alt + E
  • Unselect Occurrence Alt + Shift + E

Quick update:

if you are using the latest Intellij IDE version, pressing the Ende or the Pos1 buttons will achieve your needs. btw I am using a German keyboard.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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