简体   繁体   English

android studio / intellij idea goto 行号

[英]android studio / intellij idea goto line number

In Eclipse, if I type cmd+L, it opens a dialog for me to enter a line number and it takes me there in the code.在 Eclipse 中,如果我键入 cmd+L,它会打开一个对话框让我输入行号,然后它会将我带到代码中。 How do I do the same thing in Android Studio?我如何在 Android Studio 中做同样的事情? Instead of having to scroll each time I need a specific line number.而不必每次我需要一个特定的行号时滚动。

The shortcut to go to a specific line and/or column number is: CTRL G转到特定行号和/或列号的快捷方式是: CTRL G

Android Studio Go to Line dialog box ( archive ) 存档

Examples:例子:

  1. Go to line 6转到第 6 行
    Ctrl G 6 Enter Ctrl G 6回车

  2. Go to line 6 and column 8转到第 6 行和第 8 列
    Ctrl G 6 : 8 Enter Ctrl G 6 : 8回车

  3. Go to column 4 on the current line转到当前行的第 4 列
    Ctrl G : 4 Enter Ctrl G : 4回车


Shortcut References:快捷方式参考:

Use Command + L for Mac OS X.对于 Mac OS X 使用 Command + L。

IntellijIDEA default keymap reference Here is the IntellijIDEA default keymap reference. IntellijIDEA 默认键盘映射参考这是 IntellijIDEA 默认键盘映射参考。 This is applicable to Android Studio too.这也适用于 Android Studio。

You can also find the document from Android Studio -> Help -> Default Keymap Reference您还可以从 Android Studio -> Help -> Default Keymap Reference 找到该文档

The shortcut to go to a particular line number on Android Studio is在 Android Studio 上转到特定行号的快捷方式是

On Mac : Cmd + L在 Mac 上:Cmd + L

On Linux : Ctrl + L在 Linux 上:Ctrl + L

On Windows : Ctrl + G在 Windows 上:Ctrl + G

After this key in the line number in the dialog box that pops up.There is an option to insert the column number as well, but it is not necessary.在弹出的对话框中键入行号后。也有插入列号的选项,但不是必须的。

  • If you are in the specific file,如果您在特定文件中,

You can use Ctrl + G .您可以使用Ctrl + G And insert the line You wanted.并插入您想要的行。 If you want to go to a specific column of the lineNo you can insert lineNo : columnNo .如果要转到lineNo的特定列,可以插入lineNo : columnNo

在此处输入图像描述

  • If you are in some file and you want to navigate into some line of a some other file,如果您在某个文件中并且想要导航到某个其他文件的某行,

You can simply use default navigation shortcut Ctrl + Shift + N , and insert fileName : lineNo .您可以简单地使用默认导航快捷键Ctrl + Shift + N ,然后插入fileName : lineNo

NOTE : You don't need to insert the whole name of the file, some text that enables intellij to uniquely identify your file would be good enough.注意您不需要插入文件的全名,一些使 intellij 能够唯一标识您的文件的文本就足够了。 Your input text might turn into red color.您的输入文本可能会变成红色。 But it works.但它有效。 :) :)

在此处输入图像描述

对于 Windows 用户,快捷键是:Ctrl + G

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

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