IntelliJ IDEA 中跳转到上一个视图位置(向后/向前导航)的键盘快捷键

发布于 2024-12-04 15:22:45 字数 186 浏览 6 评论 0原文

我知道 Ctrl+Shift+Backspace 用于转到上次编辑的位置。

但我想跳转到我最近所在的位置,而不一定是我编辑过任何内容的位置。

例如,如果我使用 Ctrl+B 跳转到声明,那么我想返回到跳转之前的位置。

I know Ctrl+Shift+Backspace is used to go to the location of the last edit.

But I want to jump to whichever location I was most recently at, not necessarily one where I edited anything.

For example, if I jumped to a declaration using Ctrl+B, then I want to go back to where I was before jumping.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(20

君勿笑 2024-12-11 15:22:45

Alt + Shift + ←(左箭头)

Ctrl + E (< em>最近的文件弹出窗口)。

另请检查:

Ctrl + Shift + E最近编辑的文件弹出窗口)。

Mac 用户请将 Ctrl 替换为 ⌘(命令),将 Alt 替换为 ⌥(选项)

更新 在 v12.0 中,它是 Alt + Shift +←(向左箭头) 而不是 Alt< /kbd> + Ctrl + ←(左箭头)

更新 2 在 v14.1(可能更早)中,它是 Ctrl + [

更新 3 在 IntelliJ IDEA 2016.3 中,它是Ctrl + Alt + ←(左箭头)

更新4 在 IntelliJ IDEA 2018.3 中,它是 Alt + Shift + ←(向左箭头)

更新 5 IntelliJ IDEA 2019.3 是 Ctrl + Alt + ← (向左箭头)

Alt + Shift + ← (Left Arrow)

or

Ctrl + E (Recent Files pop-up).

Also check:

Ctrl + Shift + E (the Recently Edited Files pop-up).

Mac users, replace Ctrl with ⌘ (command) and Alt with ⌥ (option).

Update In v12.0 it's Alt + Shift +← (Left Arrow) instead of Alt + Ctrl + ← (Left Arrow).

Update 2 In v14.1 (and possibly earlier) it's Ctrl + [

Update 3 In IntelliJ IDEA 2016.3 it's Ctrl + Alt + ← (Left Arrow)

Update 4 In IntelliJ IDEA 2018.3 it's Alt + Shift + ← (Left Arrow)

Update 5 In IntelliJ IDEA 2019.3 it's Ctrl + Alt + ← (Left Arrow)

横笛休吹塞上声 2024-12-11 15:22:45

根本问题是窗口管理器使用 Ctrl+Alt+LeftRight 来切换工作区和/或用于更改屏幕方向的 OEM 实用程序。

您可以使用以下命令更改分配
文件/设置/键盘映射然后主菜单/导航找到后退前进并右键单击添加设置替代调和弦的键盘快捷键

Alt Graph+LeftAlt Graph+Right 对我来说效果很好(IceWM 下 Ubuntu 上的 IDEA 13.1.4 )。

The underlying problem is Ctrl+Alt+Left and Right are used by window managers to switch workspace and/or OEM utilities to change the screen orientation.

You can change the assignments using
File / Settings / Keymap then Main Menu / Navigate find Back and Forward and right click to Add Keyboard Shortcut to set an alternative key chord.

Alt Graph+Left and Alt Graph+Right works well for me (IDEA 13.1.4 on Ubuntu under IceWM).

月下伊人醉 2024-12-11 15:22:45

CMD + [ ->转到上一个

CMD + ] ->下一步

==========

对于 OSX,cmd + [] 是返回和继续的最佳选择。第四,由于它们离手指很近,可以避免手腕稍微扭转,减少一次按键的次数,非常适合 vim 模式下的用户。

正如OP所要求的,这与 cmd + B 配合得很好,这有助于跳转到方法/变量定义内部/到方法/变量定义,并使用 cmd 立即返回+ [.尝试一下。

CMD + [ -> Go Previous

CMD + ] -> Go Next

==========

For OSX, cmd + [ and ] are the best choices to go back & forth, Since they are found so near to fingers, avoiding you wrist twisting a bit, one keypress lesser, ideal for users in vim mode.

As the OP requested, this works well with cmd + B which facilitates jumping inside/to the method/variable definition and comes back immediately using cmd + [. Give a try.

趁微风不噪 2024-12-11 15:22:45

对于 Ubuntu,Ctrl + Alt + 向左Ctrl + Alt + 正确工作正常。

默认情况下,这些键被分配用于 Ubuntu 的工作区导航。

您需要通过转到:

系统设置> 来禁用它。键盘>快捷方式选项卡>导航并通过按退格键禁用切换到左侧工作区切换到右侧工作区

或者您可以选择更改 Intellij 本身的快捷方式:

File > Settings > Keymap > Main menu > Navigate > Back/Forward

For Ubuntu, Ctrl + Alt + Left and Ctrl + Alt + Right work fine.

By default these keys are assigned for Ubuntu's workspace navigation.

You need to disable that by going to :

System Settings > Keyboard > Shortcuts Tab > Navigation and disable Switch to workspace left and Switch to workspace right by pressing Backspace.

Or you can choose to change shortcuts in Intellij itself:

File > Settings > Keymap > Main menu > Navigate > Back/Forward
鹤舞 2024-12-11 15:22:45

问答A 内置于 Intellij ...

CTRL/CMD + SHIFT + A x 2 TYPE 插入符号

Q & A is built into Intellij ...

CTRL/CMD + SHIFT + A x 2 TYPE caret

九八野马 2024-12-11 15:22:45

对于版本 14。在 Mac 上,它是 (alt) + +

For version 14. On mac, it is (alt) + +

你怎么敢 2024-12-11 15:22:45

大多数情况下,默认快捷键组合是 Ctrl + Alt + 左/右。 (我使用的是linux版本)

或者你可以有一个工具栏选项。通过查看 -> 启用工具栏工具栏。 箭头也会做同样的事情。如果将鼠标悬停在其上,您还可以看到快捷键组合。

输入图像描述这里
输入图像描述这里

以防万一组合键不起作用(这可能是由于多种原因造成的,例如您正在使用虚拟机等),您可以更改此默认组合键,或者您可以添加额外的组合(例如:对于后退/移动到上一个 Ctrl + Alt + <逗号)。

转到设置->选择键盘映射(在搜索栏中输入键盘映射)-> **编辑器操作 ->搜索返回并找到导航选项 -> 根据您的喜好更改设置。

在此处输入图像描述

Mostly the default shortcut key combination is Ctrl + Alt + Left/Right. (I'm using the linux version)

Or you can have a toolbar option for it. Enable the tool bar by View -> Toolbar. The Left and Right Arrows will do the same. If you hover over it then you can see the shortcut key combination also.

enter image description here
enter image description here

Just in case the key combination is not working (this can be due to several reasons like you are using a virtual machine, etc) you can change this default key combination, or you can add an extra combination (ex: For Back/Move to previous Ctrl + Alt + < or Comma).

Go to Settings -> select keymap (type keymap in the search bar) -> **Editor Actions -> search for back and find Navigate options -> change the settings as you prefer.

enter image description here

z祗昰~ 2024-12-11 15:22:45

OSX 和 Android Studio 版本:

CMD+ [CMD+ ]

移动到之前的插入位置。

OSX and Android Studio version:

CMD+ [ and CMD+ ]

to move to the previous carret location.

独留℉清风醉 2024-12-11 15:22:45

到目前为止,有很多优秀的答案,它们确实回答了这个问题...但是,如果您不想处理禁用图形驱动程序的设置,或创建新的键盘映射,或通过远程会话(RDP)进行开发或在拦截您的击键的虚拟机中,老式的键盘导航仍然有效。只需执行Alt-N即可调出Navigate菜单,然后按B键。

请注意,您不要同时按下所有键。所以:

Alt-N等待B

这是我一直使用的,对于OP询问的情况正是如此。
此外,这可能会在任何 IntelliJ 更新中保持不变。

Many excellent answers so far, and they do answer the question...But, if you don't want to have to deal with disabling graphics driver's settings, or creating new keyboard mappings, or are developing through a remote session (RDP) or within a VM that intercepts your keystrokes, good-old keyboard navigation still works. Just do Alt-N to bring up the Navigate menu and then hit the B key.

Please note that you don't hit all keys at the same time. So:

Alt-N wait B

This is what I use all the time, for exactly the case that the OP asked about.
Also, this will probably hold through any IntelliJ updates.

脱离于你 2024-12-11 15:22:45

在 IntellJ 2017.2 中,

Ctrl+[Ctrl+] 在当前中的先前位置之间导航/em> 文件。

Ctrl+Alt+Ctrl+Alt+→< /kbd> 在所有文件中的先前位置之间导航。

In IntellJ 2017.2,

Ctrl+[ and Ctrl+] navigate between previous locations in the current file.

Ctrl+Alt+ and Ctrl+Alt+ navigate between previous locations in all files.

情痴 2024-12-11 15:22:45

取决于所选的键盘映射

键盘映射:Mac OS X + 左右箭头键
键盘映射: Mac OS X 10.5+ + [ / ]

我在 Pycharm 中遇到了类似的问题。要解决此问题,请更改首选项中的键盘映射。

Depends on the Keymap selected.

Keymap: Mac OS X + Left Right Arrow Keys
Keymap: Mac OS X 10.5+ + [ / ]

I was facing similar problems in Pycharm. To resolve change your Keymap in Preferences.

情绪失控 2024-12-11 15:22:45

向后/向前导航

Ctrl + Alt + 向左/向右

Navigate back/forward

Ctrl + Alt + Left/Right

や莫失莫忘 2024-12-11 15:22:45

对于 Mac 用户,使用 Command+[ 向后移动,使用 Command+] 向前移动。

For Mac users Use Command+[ for backward and Command+] for forward.

明月夜 2024-12-11 15:22:45

使用以下方法仅使用两个键会更容易:

control + Tab

Alt + Left/< kbd>右

Using the following ways using only two keys will be the easier:

control + Tab

or

Alt + Left/Right

琴流音 2024-12-11 15:22:45

您可以使用以下命令返回 2017.3.4

Alt + Left

You can use the below to navigate back in 2017.3.4

Alt + Left

南渊 2024-12-11 15:22:45

Ctrl + Alt + S,然后选择 Keymap,最后通过输入 back< 找到键盘快捷键/code> 右上角搜索栏中的单词。

Press Ctrl + Alt + S then choose Keymap and finally find the keyboard shortcut by type back word in search bar at the top right corner.

酒绊 2024-12-11 15:22:45

Intellij 2021.3.2 基本快捷键

Ctrl+Shift+E = 最近位置

Ctrl+E = 最近的文件

Ctrl+N = 查找类

Ctrl+Alt+B = 导航类

Ctrl+Shift+T = 打开该类的测试类

Intellij 2021.3.2 Basic Shortcuts

Ctrl+Shift+E = Recent Locations

Ctrl+E = Recent Files

Ctrl+N = Find the Class

Ctrl+Alt+B = Navigate the Class

Ctrl+Shift+T = Open the Test Class of the Class

拒绝两难 2024-12-11 15:22:45

就像 @itsneo 所说,我个人认为 + [] 在 Mac 上最方便。但如果你来自 Linux 方面,我可以理解。然后您可以使用 + alt +

Like @itsneo said, I personally find + [ and ] the most convenient ones on a mac. But I can understand if you come from Linux side of things. Then you can use + alt + or .

她比我温柔 2024-12-11 15:22:45

在版本 2018.1 中,导航的键盘快捷键为 Shift+Alt+LeftRight

With version 2018.1 the keyboard short cuts for navigation are Shift+Alt+Left or Right

剩一世无双 2024-12-11 15:22:45

如果您使用的是 UNIX 操作系统的 Mac 键盘;

control + alt + command + leftright 应该可以正常工作。

If you are on a mac keyboard using with UNIX OS;

control + alt + command + left or right should work for sure.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文