如何在Android Studio中的代码中选择多个位置(崇高)? [英] How to select multiple places (sublime) in code in Android Studio?

查看:258
本文介绍了如何在Android Studio中的代码中选择多个位置(崇高)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在Android Studio中的代码中选择多个位置?

How to select multiple places in code in Android Studio ?

我想在源代码的多个位置插入相同的文本.就像拥有多个鼠标光标一样.我以前在VS2012中很容易做到这一点,尽管不确定如何在Android Studio中做到这一点?

I want to insert the same text in multiple places in my source code. Like a have more than one mouse cursor. I used to do it in VS2012 so easily though not sure how to do it in Android Studio ?

推荐答案

我找到了如何与大家分享这个很棒的功能.我发现了三个很酷的功能:

I found how and lets share this cool feature with you. I found three cool features:

  1. 要进行多项选择,只需按住 alt + shift ,然后选择要通过鼠标单击进行更改的时间,然后键入一些可以在多个位置写的东西同时.

  1. For multiple selection just hold alt + shift then select whenever you want to change by mouse click then type some thing you can write at multiple places at the same time.

另一个很酷的功能是列选择.这样,您可以以一种很好的方式单击并获得很大的帮助,尤其是在重构时.

Another cool feature is column selection. This lets you to click in a great manner and greatly of help especially when you are refactoring.

在大多数系统中,它可以按住middleMouseButton并拖动您的代码来工作,而在其他系统中,它可以通过按住 alt 并选择代码来工作,如下所示:

In most systems it works with holding middleMouseButton and dragging over your code and in others it works by holding alt and selecting code it acts like below:

  1. 第三个很酷的功能是崇高的选择功能,它可以在代码中找到相同的单词,让您轻松更改或附加该单词​​.您可以通过在Windows/Linux上按 alt + j ,在Mac中按 ctrl + g 来做到这一点.看看它是如何工作的:
  1. the third cool feature is sublime selection it finds the same word in code and let you change that or append that easily. you can do that by pressing alt + j on Windows / Linux and ctrl + g in mac. Look how it works:

就像@Narayana在评论中所说的那样, Ctrl + Shift + Alt + j 选择了所有出现在一枪,一枪重构.

Also as @Narayana said in comments, Ctrl + Shift + Alt + j selects all occurrences in one shot, for one-shot refactoring.

这篇关于如何在Android Studio中的代码中选择多个位置(崇高)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆