简体   繁体   English

文件键盘快捷键的 IntelliJ 开头

[英]IntelliJ beginning of file keyboard shortcut

Is there a keyboard shortcut to move to the beginning of a file?是否有键盘快捷键可以移动到文件的开头? I checked IntelliJ's Keymap for Mac OS X and it doesn't list anything for navigating to the start of a file.我检查了 IntelliJ 的Mac OS X 键盘映射,它没有列出任何用于导航到文件开头的内容。

命令 + homefn + command + 左箭头

Edit the Intellij Preferences -> KeyMap -> Editor Actions entries for "Move Caret to Text Start" and "Move Caret to Text End". 编辑Intellij首选项 - > KeyMap - >编辑器操作条目“将插入符号移动到文本开始”和“将插入符号移动到文本结束”。 If you set those to Command+UpArrow and Command+DownArrow, it'll work like a normal text editor. 如果你将它们设置为Command + UpArrow和Command + DownArrow,它将像普通的文本编辑器一样工作。 I have no idea why that isn't the default in Intellij instead of the seemingly pointless "scroll one line" feature. 我不知道为什么这不是Intellij中的默认值而不是看似毫无意义的“滚动一行”功能。

On Mac, command + home and command + end move to the top and bottom of the file. 在Mac上, 命令 + home命令 + end移动到文件的顶部和底部。

On a Mac laptop, there are no home or end keys. 在Mac笔记本电脑上,没有家用或终端键。 Many key combinations with option / function keys produce missing keys and do other neat things. 许多具有选项 / 功能键的组合键会产生缺失的键并执行其他整洁的操作。 For instance, using function + left and function + right will provide windows-style home and end behaviour while function + up and function + down will provide page up and page down behaviour. 例如,使用function + leftfunction + right将提供windows风格的homeend行为,而function + upfunction + down将提供向上 翻页向下翻页行为。 Superuser has more information . 超级用户拥有更多信息

Also, if you open the Keyboard preferences pane and look at the Input Sources tab, you will find that the displayed keyboard changes as you press modifier keys such shift, option and function. 此外,如果您打开“ Keyboard偏好设置面板并查看“ Input Sources选项卡,您会发现显示的键盘在按下修改键(如移位,选项和功能)时会发生变化。 Your keyboard probably does way more than you thought. 你的键盘可能比你想象的要多。

The accepted answer is not correct. 接受的答案是不正确的。 To move to the beginning/end of a file, use ctrl+home/ctrl+end on Windows/Unix or command-home and command-end on the Mac, as @jackrabbit suggested. 要移动到文件的开头/结尾,请在Windows / Unix上使用ctrl + home / ctrl + end或在Mac上使用command-home和command-end,如@jackrabbit建议的那样。

ctrl+pageup (Move Caret to Page Top) moves the caret to the top of the viewable portion of the file (page, viewport). ctrl + pageup(将Caret移动到Page Top)将插入符号移动到文件可视部分的顶部(页面,视口)。 It also does not move the caret to the first column, it tries to stay in the same column that it was previously 它也不会将插入符号移动到第一列,它会尝试保留与之前相同的列

Search the Keymap preference settings, and set your own key combination for "Move Caret to Text Start" and "Move Caret to Text End". 搜索Keymap首选项设置,并为“将插入符号移动到文本开始”和“将插入符号移动到文本结束”设置自己的组合键。 This has the behavior the OP intends, where the caret is moved to the very top of the text in file, and the very end. 这具有OP意图的行为,其中插入符被移动到文件中文本的最顶部,并且最终。 :D :d

I am using IntelliJ 12, and LOVING IT! 我正在使用IntelliJ 12,并且喜欢它!

Just as an addition for clarity 同样是为了清晰起见

For Windows, 对于Windows,

Ctrl + Home => Top Ctrl + Home =>顶部

Ctrl + End => Bottom Ctrl + End =>底部

Ctrl + PgUp => Page Up Ctrl + PgUp => Page Up

Ctrl + PgDn => Page Down Ctrl + PgDn => Page Down

You're looking for:您正在寻找:

Page Up => fn + up

Page Down => fn + down

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

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