X code shortcuts & Tricks
A large number of programmers believe that the keyboard is faster for all (programming-related) tasks as compared to mouse, I am also one of them.
While programming if you know the shortcuts of your IDE then you can do the same work in more efficient way.
Here are some shortcuts that I was using to boost my productivity:
Basic Shortcuts
- Build: Command(⌘) + B
- Run: Command(⌘) + R
- Test: Command(⌘) + U
- Stop: Command(⌘) + .
- Clean: Command(⌘) + Shift(⇧) + K
- Clean the build folder: Command(⌘) + Shift(⇧) + Option(⌥) + K
- Code completion: control(⌃) + Space
Open debugger window
Command(⌘) + Shift(⇧) + Y
Open left navigation panel
Command(⌘) + 0(Zero)
We can use numbers[1,2 …] to navigate in between the tabs, for example Command(⌘) + 4 open the Search tab in left navigation.
Open right navigation panel
Command(⌘) + Option(⌥) + 0(Zero)
Here also, We can use numbers[1,2 …] to navigate in between the tabs, for example Command(⌘) + Option(⌥) + 3 open the Quick help tab in right navigation.
Assistant Editor
Command(⌘) + Option(⌥) + Return(↩)
It shows two files at once, it useful while connecting Storyboard/ Xiv views to code.
Re-Indent code
control(⌃) + I
This one is my favourite one, while writing code sometimes the code structure is not in the proper format than, we can use this. To use this code first select the block of code.
Open any file in the project
Command(⌘) + Shift(⇧) + 0
This is very useful to quickly open any file in the project.
Reveal in Project Navigator
Command + Shift(⇧) + J
When we need to find a particular file in project we use File filter but the problem is to know the root folder and module in Project Navigator, we have to open it manually. By using the shortcut we can reveal the file in Project Navigator.
Jump to Line
Command(⌘) + L
To navigate to a particular line number in a file.
Jump to Method
Press ⌃+ 6
To open up jump-bar drop-down with all the variable and method names. You can filter them by up & down key.
Edit in all scope
Command(⌘) + control + E
This one is very useful. Sometimes we need to change a variable name, so we can avoid manually changing it everywhere using this shortcut.
Code Commenting
Command(⌘) + Option(⌥) + /
The best practice in programming is to write the comment for every method, it helps the other programmer to understand your code. we can use this shortcut to write the comment above the method.
Open snippets
Command(⌘) + Shift(⇧) + L
Snippets are block of code which we frequently used in our code. we can also create your own snippets.
Move the insertion point
Command(⌘) + left/right arrow
To move the insertion point to the beginning/end of the current line.
Enjoy coding….
Soon I will come up with some amazing X-code hacks.