Skip to content

Instantly share code, notes, and snippets.

@abhinav-nath
Last active May 25, 2024 18:30
Show Gist options
  • Save abhinav-nath/61b338f1135401141361e1ee62745698 to your computer and use it in GitHub Desktop.
Save abhinav-nath/61b338f1135401141361e1ee62745698 to your computer and use it in GitHub Desktop.

Regular Expression Syntax Reference

Text Navigation

Description Mac Shortcut
Go to end of the line ⌘ →
Go to beginning of the line ⌘ ←
Move forward word by word ⌥ →
Move backwards word by word ⌥ ←
Page down fn ↓
Page up fn ↑
Go to the end of current file fn ⌘ →
Go to the beginning of current file fn ⌘ ←
Scroll horizontally 🔥 shift scroll

Editing and Working With Code

Description Mac Shortcut
Move line down shift ⌥ ↓
Move line up shift ⌥ ↑
Move statement down shift ⌘ ↓
Move statement up shift ⌘ ↑
Duplicate a line ⌘ D
Delete a line ⌘ delete
View suggested parameters of a method ⌘ P
Go to the beginning of current file fn ⌘ ←
Go to the end of current file fn ⌘ →
Comment or uncomment current selection ⌃ /
Block comment or uncomment current selection shift ⌃ /
Expand current code block ⌘ +
Fold current code block ⌘ -

Code Navigation

Description Mac Shortcut
Navigate everywhere Double shift (tab to move between sections)
Go to Class ⌘ O
Navigate back ⌘ [
Navigate forward ⌘ ]
Navigate to Symbols ⌥ ⌘ O
Navigate to Files ⌘ shift O
Navigate to Actions (themes etc) ⌘ shift A
Navigate to recent files ⌘ E
Navigate to recent locations (edited) 🔥 ⌘ shift E
Close all other tabs 🔥 ⌥ + click on close tab

Code Selection

Description Mac Shortcut
Selecting word by word shift ⌥ + ← or →
Selecting to the end of line shift ⌘ →
Selecting to the beginning of line shift ⌘ ←
Extending and Shrinking Selection ⌥ ↑ or ↓
Clone Caret above or below Double + ↑ or ↓
Add Selection for next occurrence ⌃ G
Unselect occurrence ⌃ shift G
Select all occurrences ⌃ ⌘ G

Code Completion

Description Mac Shortcut
Smart Code Completion I
  • After the new keyword in an object declaration
  • In the list of parameters of a method call
  • In return statements
⌃ shift space
Smart Code Completion II
  • For static expressions
  • For Collections, lists and arrays
⌃ shift space twice
Postfix Completion
  • null - is null?
  • nn - is not null?
  • iter - for each loop
  • var - assign to a variable
  • and many more ...
⌘ J

Code Style

Description Mac Shortcut
Move the selection one tab stop to the right tab
Move the selection one tab stop to the left shift tab
Reformat current selection or current file ⌥ ⌘ L
Move the focus to Project tool window ⌘ 1
Optimize imports ⌃ ⌥ O

Java

Description Mac Shortcut
Java classes diagram 🔥 ⌥ ⌘ shift U
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment