博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
在Android Studio中搜索整个项目中所有出现的字符串
阅读量:2290 次
发布时间:2019-05-09

本文共 2800 字,大约阅读时间需要 9 分钟。

本文翻译自:

I've just started using Android Studio (IntelliJ), and I now look for the feature to find the occurrence of a string in any of the files in my project. 我刚刚开始使用Android Studio(IntelliJ),现在寻找该功能来查找项目中任何文件中是否存在字符串。 For example: I want to find all the files that contain the string " .getUuid() " 例如:我要查找包含字符串“ .getUuid() ”的所有文件。

The search at the top right doesn't give me the correct results, and I don't think I can find this feature under Edit > Find. 右上角的搜索无法提供正确的结果,并且我认为无法在“编辑”>“查找”下找到此功能。

Could anybody point me at the right direction? 有人能指出我正确的方向吗?


#1楼

参考:


#2楼

TLDR: ⌘⇪F on MacOS will open "Find in path" dialog. TLDR:在MacOS上,⌘⇪F将打开“在路径中查找”对话框。

First of all, this IDEA has a nice " Find Usages " command. 首先,此IDEA具有一个不错的“ Find Usages ”命令。 It can be found in the context menu, when the cursor is on some field, method, etc. 当光标位于某个字段,方法等上时,可以在上下文菜单中找到它。

It's context-aware, and as far as I know, is the best way to find class, method or field usage. 据我所知,它是上下文感知的,是查找类,方法或字段用法的最佳方法。

Alternatively, you can use the 或者,您可以使用

Edit > Find > Find in path… 编辑>查找>在路径中查找…

dialog , which allows you to search the whole workspace. 对话框 ,使您可以搜索整个工作区。

Also in IDEA 13 there is an awesome " Search Everywhere " option, by default called by double Shift. 同样在IDEA 13中,还有一个很棒的“ Search Everywhere ”选项,默认情况下由double Shift调用。 It allows you to search in project, files, classes, settings, and so on. 它允许您搜索项目,文件,类,设置等。

Also you can search from Project Structure dialog with " Find in Path… ". 您也可以使用“ Find in Path… ”从“项目结构”对话框中Find in Path… Just call it by right mouse button on concrete directory and the search will be scoped, only inside that directory and it's sub-directory. 只需在具体目录上单击鼠标右键即可进行搜索,并且仅在该目录及其子目录内进行搜索。

Enjoy! 请享用!


#3楼

In Android Studio on a Windows or Linux based machine use shortcut Ctrl + Shift + F to search any string in whole project. 在基于Windows或Linux的计算机上的Android Studio中,使用快捷键Ctrl + Shift + F搜索整个项目中的任何字符串。 It's easy to remember considering Ctrl + F is used to search in the current file. 记住使用Ctrl + F来搜索当前文件很容易记住。 So just press the Shift as well. 因此,只需按Shift键

On OSX use the Command key instead of Ctrl 在OSX上,使用Command键而不是Ctrl


#4楼

按两次Shift键 ,将出现“搜索各处”对话框。


#5楼

And for all of us who use Eclipse keymaps the shortcut is Ctrl+H . 对于我们所有使用Eclipse键映射的人,快捷键是Ctrl + H。 Expect limited options compared to eclipse or you will be disappointed. 与日食相比,期望的选择有限,否则您将感到失望。


#6楼

What you want to reach is that, I believe: 我相信您想达到的目标是:

  • cmd + O for classes. cmd + O用于课程。
  • cmd + shift + O for files. cmd + shift + O用于文件。
  • cmd + alt + O for symbols. cmd + alt + O表示符号。 "wonderful shortcut!" “很棒的捷径!”

Besides shift + cmd + f for find in path && double shift to search anywhere. 除了shift + cmd + f之外,还可以在路径中查找&&双移位以在任何地方搜索。 Play with those and you will know what satisfy your need. 与这些人一起玩,您会知道什么可以满足您的需求。

转载地址:http://gicnb.baihongyu.com/

你可能感兴趣的文章
IO流删除带内容的目录
查看>>
IO流创建java文件列表
查看>>
Properties存取配置文件
查看>>
记录应用程序运行次数
查看>>
打印流PrintStream和PrintWriter
查看>>
IO流 合并流 SequenceInputStream
查看>>
IO流切割文件
查看>>
IO流-对象序列化操作流
查看>>
io流-多线程连接管道流
查看>>
RandomAccessFile可实现数据的分段写入也就是多线程下载
查看>>
DataInputStream与DataOutputStream用于操作基本数据类型的数据的流对象
查看>>
ByteArrayStream用于操作字节数组的流对象
查看>>
IO流-字符编码表转换示例
查看>>
IO流-转换流的字符编码转换-ISO-8859-1和utf-8和GBK互转
查看>>
网络游戏线上活动的类型及特点(二)
查看>>
sleeping-to-save-cpu
查看>>
键盘符号英语读法
查看>>
[转]char_traits
查看>>
[转载] 人生三重境界
查看>>
[转载]学习时注意思考方法
查看>>