Keyboard Shortcuts for NetBeans, Sublime Text and PhpStorm

Aha! so you too looking for a keyboard hack ;) Spend time finding the correct menu for a specific action and forgot afterwards. Then why not use keyboard shortcuts which might come handy.

I had worked on many PHP editor and I'm the type of guy who loves to use the keyboard more than a mouse only exception when I'm playing games. So the problem that I face I get used to a certain shortcut for specific actions on a specific IDE but when I have to do the same thing in the different editor then I have to take the help of Google. So I thought to why not put them into paper so that I can get the think on the same place and at the same time developer like me do not have to check respective IDE website for the same and bookmark a single link.

# Name Netbeans Sublime phpStorm
Finding, Searching, and Replacing
1 Find in file Ctrl + F Ctrl + F Ctrl + F
2 Find Next Enter F3 F3
3 Find Previous Shift + Enter Shift + F3 Shift + F3
4 Replace in file Ctrl + H Ctrl + H Ctrl + R
5 Find class. Ctrl + O Ctrl + P Ctrl + N
6 Find in project Ctrl + Shift + F Ctrl + Shift + F Ctrl + Shift + F
7 Replace in project Ctrl + Shift + H Ctrl + Shift + H Ctrl + Shift + R
8 Show Clipboard History Ctrl + Shift + D Ctrl + K + V Ctrl + Shift + V
9 Copy file path Alt + Shift + L N/A*[2-5] Ctrl + Shift + C
10 Copy whole line Ctrl + Shift + ↓ Ctrl + Shift + ↑ Ctrl + Shift + D Ctrl + D
11 Select next auto-complete suggestion Ctrl + [SPACE] Ctrl + [SPACE] Ctrl + [SPACE]
12 Go to declaration Ctrl + B N/A*[6-9] Ctrl + B
Window Manipulation
13 Close selected window Ctrl + F4 Ctrl + W Ctrl + F4 Ctrl + W
14 Close all windows Ctrl + Shift + F4 N/A*[10-13] N/A
15 Reopen recently closed file Ctrl + Shift + T N/A*[14-20] Ctrl + E
16 Toggle between editor types Ctrl + Alt + PgUp Ctrl + Alt + PgDown N/A Alt + ← Alt + →
17 Zoom text in / out Alt + Mouse Wheel Up / Down Ctrl + Mouse Wheel Up / Down Ctrl + Mouse Wheel Up / Down
Navigation
18 Open Class Ctrl + O Ctrl + P Ctrl + N
19 Open File by Name Alt + Shift + O Ctrl + P Ctrl + Shift + N
20 Open Method Ctrl + 7 Ctrl + P, @ Ctrl + F12
21 Search Symbol Ctrl + 7 Ctrl + P, @ Ctrl + Shift + Alt + N
22 Go to line Ctrl + G Ctrl + G Ctrl + G
23 Go to Next Tab by order used Ctrl + Tab Ctrl + PgDown Ctrl + Tab
24 Go to Previous Tab by order used Ctrl + Shift + Tab Ctrl + PgUp Ctrl + Shift + Tab
25 Move caret to matching bracket Ctrl + [ Ctrl + M Ctrl + Shift + M
26 Go backward/forward/to last edit Alt + ← Alt + → Ctrl + Q Alt + Minus [21-28] Ctrl + Shift + Backspace
27 Next/previous marked Occurrence
(or Quick view the usages of the selected symbol.)
Alt + ↓ Alt + ↑ N/A Ctrl + Shift + F7
Bookmarks
28 New Bookmark Ctrl + Shift + M Ctrl + F2 F11
29 Clear Bookmark Ctrl + Shift + M Ctrl + Shift + F2 Shift + F11 + Delete
30 Next Bookmark Ctrl + Shift + . F2 Shift + F11 + ↓
31 Previous Bookmark Ctrl + Shift + / Shift + F2 Shift + F11 + ↑
Code Folding
32 Fold Selection Ctrl + Minus Ctrl + Shift + [ Ctrl + Minus
33 UnFold Selection Ctrl + Plus Ctrl + Shift + ] Ctrl + Plus
34 Fold All Ctrl + Shift + Minus Ctrl + K + 1 Ctrl + Shift + Minus
35 UnFold All Ctrl + Shift + Plus Ctrl + K + J Ctrl + Shift + Plus
Commenting
36 Comment/un-comment current line Ctrl + / Ctrl + Shift + C Ctrl + / Ctrl + /
37 Block comment current selection Ctrl + / Ctrl + Shift + C Ctrl + Shift + / Ctrl + Shift + /

There is some action which does not have inbuild shortcut in a Sublime Text editor so you have to define it manually under Preferences > Key Bindings - User and copy paste the below mentions array.

[
	{
		"keys": ["ctrl+alt+c"],
		"command": "copy_path"
	}, 
  	{
		"keys": ["shift+command+m"],
		"command": "goto_definition"
	}, 
  	{
		"keys": ["ctrl+shift+w"],
		"command": "close_all"
	}, 
  	{
		"keys": "ctrl+shift+t",
		"command": "open_recent_file",
		"args": {
			"index": 0
		}
	}, 
  	{
		"keys": ["ctrl+alt+left"],
		"command": "jump_back"
	}, 
  	{
		"keys": ["ctrl+alt+right"],
		"command": "jump_forward"
	}
]

Please Note:

  • When I have written this shortcuts based on NetBeans IDE 8.2, JetBrains PhpStorm 10.0.1 and Sublime Text 3 (Build 3143)
  • If you are using Mac OS then replace Ctrl with command key

Do let me know through below comments if it helps you or not or if I miss out any important shortcut.

Raunak Gupta

Raunak Gupta

I'm Raunak Gupta, a seasoned software developer with over 9 years of experience in a wide range of programming languages, frameworks, and tools. I started my journey as a WordPress & CakePHP developer in 2014, diving deep into the world of OOPs, Request handling, and SEO. Along the way, I crafted numerous dazzling WooCommerce stores, tamed payment gateways, optimized for full filament functionality, and achieved ultra-low latency for lightning-fast load times. My expertise extends to BI tools, website builders, DevOps, and team leadership. I like to help upcoming developers, so I share my experience through this blog and by assisting fellow developers on Stack Overflow, where I've earned a stellar reputation with over 10k+ points of recognition.

Articles: 29

7 Comments

  1. Verry good work!
    I’m missing only one shortcut… I think you could add one that I think is essential: [Shift + Alt + F] (on Netbeans) to auto-indent the whole file at once!
    My code routine is something like that:
    1- Write a line,
    2 – press [Shift + Alt + F] to auto-indent the file,
    3 – then [Ctrl + s] twice just for safety! 😀

    So is there this same shortcut on Sublime?
    And what I’d really love is to copy the whole shortcuts from Netbeans to Sublime! then I could use it! 😀

    Thanks!

    • Thanks Leonardo, for pointing out the indent shortcut keyword.
      I don’t know how could I skip such a useful shortcut.

  2. I was curious if you ever considered changing the layout of your
    blog? Its very well written; I love what youve got to say.
    But maybe you could a little more in the way of content so people could connect with it better.
    Youve got an awful lot of text for only having 1
    or two images. Maybe you could space it out better?

    • Hi @Harley,

      Thank you for the details review, we are on the way to change the layout. New look will be rolled-out in 1-2 week(s).

Leave a Reply to Raunak GuptaCancel Reply

Your email address will not be published. Required fields are marked *