Developer Productivity Guide
Become a more productive developer, within this short and sweet guide you might learn something that you have always wondered how to do or never knew existed! This guide will mostly talk about your JetBrains IDE and some other tips that would apply on both platforms Windows and Mac.
Here's the outline of what I will be talking about:
- Any JetBrains IDE (IntelliJ, PHPStorm, WebStorm, etc...) [https://www.jetbrains.com/help/idea/2016.2/]
- Emmet (http://emmet.io/)
- Command Line Terminal Tips
- ZSH Configuration
- Performance Optimizations
JetBrains IDE (IntelliJ, PHPStorm, WebStorm, etc...):
- We want to activate our F1, F2, F3 to use as our standard function keys so that we can use as much shortcuts as we can: Go to
System Preferences / Keyboard / Keyboardand uncheck the item that says "Use all F1, F2, etc. as standard function keys."
- If we ever want to use our special keys we just hold FN key and change the volume for example.
This section will be organized by component:
- Editor ESC
- Moving the cursor efficiently
- Selecting / Highlighting
- Using the mouse
- Code Completion
- Project Navigation CMD 1
- Version Control CMD 9
- Embedded Terminal ALT F12
- Preferences CMD ,
- Searching Efficiently
- Shortcut hotkeys for searching
- Shortcut Hot keys you can not live without
- Productivity Guide
Basic Shortcut Keys
We want to try to keep our hands on the keyboard and learn and memorize shortcut hotkeys as much as possible! Take your time on these and get them stuck in your head and in the long run you will thank yourself.
1. Moving the cursor efficiently
|Moving your cursor to the next or previous line||CTRL N or CTRL P|
|Moving to end or beginning of the line of code||CMD ← or CMD →|
|Moving forward in line of code||CTRL F|
|Moving backward in line of code||CTRL B|
|Moving word by word in line of code||ALT ← or ALT →|
2. Selecting / Highlighting
|Highlight the next occurrence of highlighted code||CMD G|
|Highlight the previous occurrence of highlighted code||SHIFT CMD G|
|Highlight same code occurrence with||CTRL G or CTRL SHIFT G|
|Highlight code based on its grammar or enclosed blocks of code||ALT ↑ or ALT ↑|
|Highlight a character at a time||SHIFT ← or SHIFT →|
|Highlight up or down line by line of code||SHIFT ↑ or SHIFT ↓|
|Highlight the rest of the line of code on the right or left side||SHIFT CMD ← or SHIFT CMD →|
|Highlight enclosed blocks of code||ALT ↑ or ALT ↓|
|Highlight each by word and punctuation||CMD SHIFT ← or CMD SHIFT →|
|Duplicate your current highlighted code||CMD D|
|Move the current line of code up||SHIFT CMD ↓ SHIFT CMD ↑|
|Comment or uncomment a line of code||CMD /|
|Comment or uncomment a multi-line of code||CMD ALT /|
|Expand or collapse a code block||CMD + or CMD -|
|Surround with highlighted code with something||ALT CMD T|
|Reformat or line code up||CMD ALT L|
|Delete whole line||CMD DELETE|
|Smart Line Joining, Pressing multiple times will keep joining the lines.||CTRL SHIFT J|
|Create new lines without moving the cursor||CMD ENTER|
|Toggle Letter Case and you can even toggle multilines.||CMD SHIFT U|
|Deleting the word starting from the current caret location up to the word end||ALT DELETE|
4. Using the mouse
|You can use your mouse to spread multiple cursors around your code||Hold ALT and Move mouse|
|See more information about the piece of code by holding||Hold CMD and Hover mouse over code|
|Going directly to code's definition||Hold CMD and click code|
5. Code completion
- If you want to see Basic Code Completion suggestions you can press CTRL SPACE
- It will show suggestions for variables, types, methods, expressions, and more.
- We also have Statement Completion it will add missing parentheses, brackets, braces, and other necessary formatting with SHIFT CMD ENTER
- You can also press enter if your code completion suggestion is first in the list to automatically insert.
- Hippie Completion (Cycles through keywords, class names, methods, or variables within the file) with ALT / don't know if anyone uses this, I just always type it in.
- Quickly go to your project window by typing in CMD 1 and go back to you code editor by pressing ESC.
- You can search for any files by just typing while you are in the project window.
- You can choose to show only your changed files.
- You can choose to show by
Structureinstead of by files. This is useful if you are in a huge file and just want to see seperated class names, methods, functions, and so on.
- Click the
targetfor it to immediately point you to your current file opened in your code editor.
- Click the
collapseto collapse all files and folders to root.
- One useful thing is the
Autoscroll from sourcewhich automatically moves to the current file that you are editing in your code editor.
- You can quickly open up version control by pressing CMD 9
- Quickly see version control operations with CTRL V
- Choose a way to update your project with CMD T
- Shows Git Log visually and you can select each commit to compare differences.
- You can use annotate to see who has changed something previously
- See all your local changes.
- You can create a changelist to make sure those files will not be commited.
- See Differences between local and previously committed files.
- When you get a merge conflict, we can fix easily by right clicking the file -> Git -> Fix Merge Conflict (The best feature in my opinion)
1. Shortcut hotkeys for searching
|Find something in your current file||CMD F|
|Find and replace in current file||CMD R|
|Find in Path||CMD SHIFT G|
|Find and Replace in Path||CMD SHIFT R|
|Find a Class to go to||CMD O|
|Find a File to go to||CMD SHIFT O|
|Find a Symbol to go to||CMD ALT O|
|Find a Line number in current file and jump to it||CMD L|
|Find an Action or Option name||CMD SHIFT A|
|Search Everywhere!||Double Tap SHIFT|
- Filter your search by clicking the gear icon to only look in specific areas.
- Search by Regex, by whole words, or turn on case sensitivity.
- Search with wildcards(*) for example
*Block.php or Block.*
- Search by each capital letter in file name.
- Search by typing in the path for example
- Search file with and jump to line number when opened. For Example
- Search for structural blocks/templates with by finding an action and look for
Search Structurallyyou can also replace a block of code with
Shortcut hot keys you can not live without
|Create a new file and more||CMD N|
|Quickly go to usage or find multiple usages||CMD B|
|Retrieve Parameter Information||CMD P|
|Find more documentation on highlighted (double tap detailed documentation)||CTRL J|
|Show intention actions and quick fixes||ALT ENTER|
|Navigate between opened tabs||SHIFT CMD ] or SHIFT CMD [|
|Navigate through tabs with history||CMD [ or CMD ]|
|Close active editor tab||CMD W|
|Scale your current window||SHIFT CMD and
|Open Embedded Terminal||ALT F12|
- Since its built in, you can see your productivity guide by going to Help -> Productivity Guide
- Shows how much time you have saved using code completion has saved you.
- Shows you how many possible bugs that the IDE has saved you from.
- Shows all IDE features that are related to productivity and how many times you have used it.
- Shows information on how to use it.
- Our IDE includes Emmet by default. It is a plugin that increases your code editing workflow.
- Includes HTML, CSS, and XSL fast on tab snippets!
- Go to the website and read the documentation, it is pretty worth it.
- Their cheatsheet is at (http://docs.emmet.io/cheat-sheet/)
- Move word by word when moving the cursor of the command with ALT ← for forward and ESC → for backwards. Note: The Imbedded Termainal in IntelliJ doesn't work with this, instead they use the olds school way.
- The old school way to moving the cursor is ESC B for backwards and ESC F for forwards
- Move at the end of the line or beginning with CTRL E or CTRL A
- Run multiple commands in one line
git add . && git commit 'commit test' && git push origin master
- To clear window
- To cancel what you entered CMD C
- View contents of a file with
- Previous command
!sshto show previous command that we used that began with
- Navigation through folders with
cdpressing tab finish off what you were searching for
- See a list of commands you've previously entered
- Undo something with CTRL -
- Show previous single commands by also using the up and down arrows on your keyboard also.
- Do a search between all your commands with CMD R
- Want to always see hidden files? Use:
defaults write com.apple.finder AppleShowAllFiles -bool TRUEand false if you want to turn that off.
- We can make our Mac talk to us with
say 'Hello Codetony'
- open source, community-driven framework for managing your ZSH configuration. It comes bundled with a ton of helpful functions, helpers, plugins, and themes
- IDE too slow? We can increase its memory limit in the VM Options.
Go to HELP -> Edit Custom VM Options
-Xms128m -Xmx2048m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=64m -XX:+UseCodeCacheFlushing -XX:+UseCompressedOops
Nice to knows:
- We can also transfer over settings by creating a
settings.jargoing to EDIT -> Export Settings or EDIT -> Import Settings to transfering settings.