Thursday, 24 July 2014

Android Studio Shortcuts

Here is the category-wise list of shortcuts for Android Studio IDE.

Using them in day to day programming with Android Studio will definitely save your time!!.

Search/Find/Replace:


Ctrl + F Find in current file
F3 Find Next in current file
Shift + F3 Find Previous in current file
Ctrl + R Replace in current file
Ctrl + Shift + F Find in Path (Whole Project, Module or Directory)
Ctrl + Shift + R Replace in Path
Alt + F7 Find Usages
Ctrl + Alt + F7 Show Usages in a Popup


Code Assistance:


Alt + Enter Quick Fix
Ctrl + Space Assistance in code completion
Ctrl + Q Show Documentation for selected element

Ctrl + P

Show Parameters for selected method

Alt + Insert

Generate Code (Constructor, Getter/setter, equals(), hashcode() etc..)

Ctrl + O

Select Methods to override/implement

Ctrl + Alt + O

Optimize imports

Ctrl + Alt + T

Surround with (if/else, try/catch, do/while etc..)

Shift + F6

Rename

Ctrl + D

Duplicate selected piece of code (*It is not Delete Line)

Ctrl + F4

Close current editor window

Ctrl + F12

Displays File Structure (methods and instance variables for a
class)

Ctrl + Shift + F12

Maximize or restore current editor window

Ctrl + Alt + S

Displays Settings dialog

Ctrl + Alt + Shift + S

Displays Project Structure dialog


Navigation:



Ctrl + N

Go to class

Ctrl + Shift + N

Go to File

F4

Go to Source (goes to implementation for method, declaration
for variable)

Ctrl + G

Go to Line

Ctrl + B

Go to Declaration of class, method or variable

Ctrl + E

Recent Files popup

Alt + Up Arrow

Navigate to previous method in editor window

Alt + Down Arrow

Navigate to next method in editor window

Alt + Left Arrow

Navigate to previous editor window

Alt + Right Arrow

Navigate to next editor window
Ctrl + U
Go to parent of selected element
Ctrl + H
Displays Type hierarchy

Ctrl +Shift + H

Displays Call hierarchy


Add/Remove Comments:



Ctrl + /

Toggle line comment (comment/uncomment using '//' )

Ctrl + Shift + /

Toggle block comment (comment/uncomment using '/*....*/' )



Debug/Run:



Shift + F9

Debug

Shift + F10

Run

Alt + Shift + F9

Select configuration and Debug

Alt +Shift + F10

Select configuration and Run


Deletion:


Ctrl+Y Deletes current line
Ctrl+Del Deletes word next to cursor position
Ctrl+Backspace Deletes word previous to cursor position


Indentions:


Alt + Ctrl + i Correct indentions of selected lines
Tab Increase Indent of selected lines
Shift+Tab Decrease Indent of selected lines



General Editing:


Ctrl + C or Ctrl + Insert Copy
Ctrl + X or Shift + Del Cut
Ctrl + V or Shift + Insert Paste
Ctrl + Y Delete current line(*It is not Redo)




Eclipse Shortcuts

Below is the category-wise list of commonly used shortcuts in Eclipse IDE. 

Learning and using them in day to day programming while using Eclipse will definitely make you a smarter developer and save your time as well!!


Working With Files:


Ctrl + N Create New Project, File etc.
Ctrl + S Save File
Ctrl + Shift + S Save All Files
Ctrl + W or Ctrl + F4 Close File
Ctrl + Shift + W or 
Ctrl + Shift + F4
Close All Files


Search/Find/Replace:



Ctrl + F
Displays Find/
Replace dialog
Ctrl + H
Displays search dialog
(file/java/C/C++/git search)
Ctrl + K
Find Occurrences of
selected text in file


Navigation:


Ctrl + F8 Switch Perspective
Ctrl + Shift + R
Open any Resource
(file, folder, project etc.)
Ctrl + E Displays list of open editors. Allows search within list
F12 Move focus to editor window
Alt + Left arrow   or
Ctrl+Page Up
Switch to previous editor window
Alt +Right arrow  or
Ctrl+Page Down
Switch to next editor window
Ctrl + F10 To get options of show/hide line no,show quick diff, toggle/disable breakpoint
Ctrl + Left arrow moves cursor left by one element in current line
Ctrl + Right arrow moves cursor right by one element in current line
Ctrl + Up arrow Scroll up in editor
Ctrl + Down arrow Scroll down in editor
Ctrl +Shift + Left arrow Extend selection to left by one element
Ctrl +Shift + Right arrow Extend selection to right by one element
Ctrl +Shift + Up arrow Moves cursor to previous method
Ctrl+ Shift+ Down arrow Moves cursor to next method
Ctrl + Shift + P
For a selected bracket,moves cursor to matching
opening/closing bracket
Alt + Up arrow Moves selected line up in file
Alt + Down arrow Moves selected line down in file


Assistance while coding:


F3 Goes to implementation of selected class/method
F4 Opens type hierarchy window for selected class
Ctrl + L Go to a particular line
Ctrl + O Displays structure of current class 
(methods,instance variables etc.)
Ctrl + T Displays inheritance tree of selected class or method
Ctrl + M Maximize or restore current editor window
Ctrl + Shift + T Search for a particular file
Ctrl + Space Assistance in code completion
Ctrl + Shift + O Adds missing import statements
Alt + Shift + R Rename selected element
(project/source folder/resource/
package/compilation unit/method/variables etc.)


Add/Remove Comments:


Ctrl + / Toggle comment(comment/uncomment 
selected piece of code using '//')
Ctrl + Shift + / Comment selected piece of code 
using block comment (/*.....*/)
Ctrl + Shift+ \ Removes block comment around selection
Alt + Shift + J Generate Element Comment
 

Debug/Run:


F11 Debug
Ctrl + F11 Run
F5 (Inside Debug perspective) Step Into
F6 (Inside Debug perspective) Step Over
F7 (Inside Debug perspective) Step Out
F8 (Inside Debug perspective) Jump to next 
breakpoint or watchpoint

Breakpoint:


Ctrl + Shift + B Toggle breakpoint for a selected line


Deletion:


Ctrl + D Deletes current line
Ctrl + Del Deletes word next to cursor position
Ctrl + Backspace Deletes word previous to cursor position


Indentions:


Ctrl + i Correct indentions of selected lines
Tab Increase indent of selected lines
Shift + Tab Decrease indent of selected lines


General Editing:



Ctrl  +  C   Copy
Ctrl  +  X   Cut
Ctrl  +  V   Paste
Ctrl  +  Z   Undo
Ctrl  +  Y   Redo
Ctrl  +  A  Select All