Android Studio – Mẹo và Thủ thuật – Tips and Cheaps

Mở nhanh

Mở Class: Ctrl + N
Mở File: Ctrl + Shift + N
Mở Task: Alt + Shift + N

Di chuyển

Đến vị trí con trỏ cũ: Ctrl + Alt + Left/Right (làm gì xong về chỗ cũ)
Đến vị trí chỉnh sửa cũ: Ctrl + Shift + backspace
Android Studio LogoĐến biến khai báo: Ctrl + B = Ctrl + Click

Highlight Code: ctrl+shift+f7 (Hủy =esc)

Android Studio Logo

Chuyển con trỏ đến Methods, Inner Classes khác: alt+up/down

Android Studio Logo

Mở File Structure nhanh: Ctrl + F12 

Android Studio Logo

Xem cấp bậc Method (The Call Hierarchy Popup): ctrl+alt+h

Android Studio Logo

 Xem định nghĩa nhanh: ctrl+shift+iAndroid Studio Logo

Đóng hiện Nhóm code: ctrl+shift+plus/minus

Android Studio Logo

Bookmarks!

Toggle Bookmark: F11

Toggle Bookmark With Mnemonic: ctrl+f11

Nếu bookmark có số: ctrl+number

Show Bookmarks shift+f11

Android Studio Logo

Tìm Hành động trong menu: ctrl+shift+a

Android Studio Logo

Chuyển dòng lên xuống: alt+shift+up/down

Android Studio Logo

Xóa dòng: ctrl+y

Android Studio Logo

trích: http://www.developerphil.com/android-studio-tips-of-the-day-roundup-1/

Nhân đôi dòng (Duplicate): ctrl+d

Android Studio Logo

Tăng, Giảm vùng chọn: ctrl+w / ctrl+shift+w

Android Studio Logo

Rào (surround) hàm (thêm if, …): ctrl+alt+t

Android Studio Logo

Mở File gần đây: Ctrl + E, Ctrl + Tab

Android Studio Logo

Di chuyển Method: ctrl+shift+up/down

Android Studio Logo

  Hoàn thành Method, code nhanh, khỏi chuyển xuống cuối: ctrl+shift+enter

 Android Studio Logo

Kết hợp dòng: ctrl+shift+j

 Android Studio Logo

Chọn Nhanh vị trí trong (Structure, file…, bar): alt+f1

 Android Studio Logo

Unwrap/Remove: ctrl+shift+delete

 Android Studio Logo

 Toggle Breakpoints: Ctrl+F8

 Expand Shrink Selection

Đổi biến khi Debug: Right Click Breakpoint

Expand Shrink Selection

Tạo Log Debug: Nhấp Phải Breakpoint

Logging Breakpoints

Tạo Breakpoint Tạm: Ctrl+Alt+Shift+F8 = Alt+Left Click in the left gutter

Temporary Breakpoints

 Ẩn Breakpoint: Alt+Left Click on an existing breakpoint in the left gutter

Expand Shrink Selection

 Đính kèm hàm khi Debug: Build / Attach to Android Process

 Attach Debugger

Xem Biến nhanh qua cửa sổ (Evaluate Expression): Alt+F8

 Evaluate Expression

Xem giá trị biến (Inspect Variable): Alt+Left Click biến

Inspect Variable

Mark Object: right-click and select “Mark Object”

Mark Object

 Phân tích dữ liệu tại chỗ: Menu: Analyze → Analyze Data Flow to Here

Analyze Data flow to Here

Chọn nhiều, thay đổi nhiều dòng cùng lúc: Alt+J

Sublime Text Multi Selection

Chọn nhiều Cột: Alt+MouseDrag = Shift+Alt+Insert

Column Selection

Postfix Completion:

gợi ý từ khóa:

  • .for (for a foreach)
  • .format (wraps a string in String.format())
  • .cast (wraps a statement in a type cast)

 Postfix Completion

So sánh với Clipboard: right-click the selection and select Compare With Clipboard

Find action: compare with clipboard

Compare With Clipboard

 VCS Operation Popup: Alt+`

VCS Operations Popup

Compare With Branch (Git):

  • Menu (for git): VCS -> Git -> Compare With Branch
  • Find Actions: Compare With Branch
Compare With Branch (Git)

Trích: http://www.developerphil.com/android-studio-tips-of-the-day-roundup-4/

Enter vs Tab for Code Completion: enter or tab

Enter vs Tab for Code Completion

  • Return and keep panel open: Escape
  • Close panel and Return: Shift+Escape

Return to the Editor

Jump to Last Tool Window (F12)

Jump to Last Tool Window

Hide All Panels (Ẩn mọi Panels): Ctrl+Shift+F12

Hide All Panels

 Thông tin tham số trong Hàm (Parameter Info): Ctrl+P

 Parameter Info

Đổi Tab nhanh: Ctrl+Tab

The Switcher

 Thông tin hàm: Ctrl+Shift+Q, Ctrl + Q

Context Info

Trích: http://www.developerphil.com/android-studio-tips-of-the-day-roundup-5/

Refactor This:  Ctrl+Alt+Shift+T

 Refactor This

Mở file Liên quan (Related File): Ctrl+Cmd+Up

Related File

Extract Variable: Ctrl+Alt+V

Extract Variable

Extract Parameter: Ctrl+Alt+P

  Extract Parameter

Extract Method: Ctrl+Alt+M

 Extract Method

Gom dòng (Inline): Ctrl+Alt+M

Inline

Đổi tên:  Shift+F6

Rename

Pull Up / Push Down: Ctrl+Alt+Shift+T and choose pull members up / push members down

 Pull Up / Push Down

Trích: http://www.developerphil.com/android-studio-tips-of-the-day-roundup-6/

Published by

Trại Tâm Thần

Nothing best, Nothing Perfect, Nothing imposible, Just Terrible Almost thing

Leave a comment