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

查看:30
本文介绍了如何在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. 第三个很酷的功能是 sublime selection,它可以在代码中找到相同的单词,并让您轻松更改或附加.你可以通过在 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天全站免登陆