58 ide intellij-idea android-studio
在eclipse中,我们使用Alt+ ↑/ ↓ 来向上或向下移动线.
android studio中有任何快捷方式吗?或者任何快速避免复制和粘贴的方法?
如果你想要eclipse的确切行为,你可以这样做:
文件 - >设置 - >键盘映射 - >代码 - >折叠 - >分配Alt+ ↑/ ↓到" 向上/向下移动 "而不是" 向上/向下移动语句 "
Android Studio 中有(至少)两种向上/向下移动线:“智能”一种和“哑”一种。就像 IngoAlbers 说的那样,愚蠢的人 ( Shift+ Alt+<Arrow>)只是移动的线。
使用Ctrl+ Shift+<Arrow>代替,使得功能更加智能化:
它不会离开当前的“上下文”:
public static void test() {
int i = 5;
Runnable theodor = new Runnable() {
public void run() {
System.out.println("Hi!");
}
};
}
Run Code Online (Sandbox Code Playgroud)
将int i = 5;线向下移动一步,为您带来:
public static void test() {
Runnable theodor = new Runnable() {
public void run() {
System.out.println("Hi!");
}
};
int i = 5;
}
Run Code Online (Sandbox Code Playgroud)它将方法保持在一起:
public static void hello() {
System.out.println("Hello!");
}
public static void dinner() {
System.out.println("Dinner's ready!");
}
public static void sleep() {
System.out.println("Good night.");
}
Run Code Online (Sandbox Code Playgroud)
将线public static void sleep() {向上移动一步移动sleep()上面的完整方法dinner():
public static void hello() {
System.out.println("Hello!");
}
public static void sleep() {
System.out.println("Good night.");
}
public static void dinner() {
System.out.println("Dinner's ready!");
}
Run Code Online (Sandbox Code Playgroud)在大多数情况下,这只是令人讨厌。;-)
| 归档时间: |
|
| 查看次数: |
17503 次 |
| 最近记录: |