macos IntelliJ 文件开头键盘快捷键

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7110573/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-21 08:19:08  来源:igfitidea点击:

IntelliJ beginning of file keyboard shortcut

macosintellij-ideakeyboard-shortcutsintellij-13

提问by Steve Kuo

Is there a keyboard shortcut to move to the beginning of a file? I checked IntelliJ's Keymap for Mac OS Xand it doesn't list anything for navigating to the start of a file.

是否有移动到文件开头的键盘快捷键?我检查了 IntelliJ 的Mac OS X 键盘映射,它没有列出任何用于导航到文件开头的内容。

回答by Kirby

command+homeor fn+command+left arrow

command+homefn+ command+left arrow

回答by Nathan Beach

Edit the Intellij Preferences -> KeyMap -> Editor Actions entries for "Move Caret to Text Start" and "Move Caret to Text End". If you set those to Command+UpArrow and Command+DownArrow, it'll work like a normal text editor. I have no idea why that isn't the default in Intellij instead of the seemingly pointless "scroll one line" feature.

为“Move Caret to Text Start”和“Move Caret to Text End”编辑 Intellij Preferences -> KeyMap -> Editor Actions 条目。如果您将它们设置为 Command+UpArrow 和 Command+DownArrow,它将像普通文本编辑器一样工作。我不知道为什么这不是 Intellij 中的默认设置,而不是看似毫无意义的“滚动一行”功能。

回答by Hymanrabbit

On Mac, command+homeand command+endmove to the top and bottom of the file.

在 Mac 上,command+homecommand+end移动到文件的顶部和底部。

On a Mac laptop, there are no home or end keys. Many key combinations with option/functionkeys produce missing keys and do other neat things. For instance, using function+leftand function+rightwill provide windows-style homeand endbehaviour while function+upand function+downwill provide page upand page downbehaviour. Superuser has more information.

在 Mac 笔记本电脑上,没有主页或结束键。许多带有option/function键的组合键会产生丢失的键并做其他巧妙的事情。例如,使用function+leftfunction+right将提供 windows 样式homeend行为,而function+upfunction+down将提供page uppage down行为。超级用户有更多信息

Also, if you open the Keyboardpreferences pane and look at the Input Sourcestab, you will find that the displayed keyboard changes as you press modifier keys such shift, option and function. Your keyboard probably does way more than you thought.

此外,如果您打开Keyboard首选项窗格并查看Input Sources选项卡,您会发现显示的键盘会随着您按修改键(例如 shift、option 和 function)而改变。您的键盘可能比您想象的要多得多。

回答by Juan Mendes

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 @Hymanrabbit suggested.

接受的答案不正确。如@Hymanrabbit 建议的那样,要移动到文件的开头/结尾,请在 Windows/Unix 上使用 ctrl+home/ctrl+end 或在 Mac 上使用 command-home 和 command-end。

ctrl+pageup (Move Caret to Page Top) moves the caret to the top of the viewable portion of the file (page, viewport). It also does not move the caret to the first column, it tries to stay in the same column that it was previously

ctrl+pageup (Move Caret to Page Top) 将插入符移动到文件可见部分(页面、视口)的顶部。它也不会将插入符号移动到第一列,而是尝试保持在之前所在的列中

回答by user1956066

Search the Keymap preference settings, and set your own key combination for "Move Caret to Text Start" and "Move Caret to Text End". 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. :D

搜索 Keymap 首选项设置,并为“Move Caret to Text Start”和“Move Caret to Text End”设置您自己的组合键。这具有 OP 想要的行为,其中插入符号移动到文件中文本的最顶部,以及最后。:D

I am using IntelliJ 12, and LOVING IT!

我正在使用 IntelliJ 12,并且喜欢它!

回答by Supun Wijerathne

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=> 向上翻页

Ctrl+ PgDn=> Page Down

Ctrl+ PgDn=> 向下翻页