Skip to content

Instantly share code, notes, and snippets.

@licode
Created January 17, 2015 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save licode/da683f61b74daa4fa18e to your computer and use it in GitHub Desktop.
Save licode/da683f61b74daa4fa18e to your computer and use it in GitHub Desktop.
PyCharm mac
Mac PyCharm keyboard shortcuts
------------------------------
--Fred 10/4/2012
--Fred 11/10/2014
Note: This is based on the "Mac OS X 10.5+ keymap". The default Mac
keymap is similar, but different. The Windows keymaps is similar
but different. Also: Mac Cmd = Windows Ctrl, Mac Opt = Wndows Alt
Keyboard shortcuts I use most often (other than standard Windows/Mac keys)
--------------------------------------------------------------------------
Cmd-Shift-A Find PyCharm menu items, actions, preferences, etc.
Drag tabs Tear-off tabs to see side-by-side editor windows
Cmd-W Close editor tab
Cmd-Q Quit
Cmd-Click Goto declaration of current variable
Cmd-Down Goto declaration of current variable
Cmd-B Goto declaration of current variable
Ctrl-Shift-B Goto declaration of type of current variable
Cmd-F12 Goto method (with checkbox for inherited methods too)
- To see what class you are in right now:
- Cmd-F12, Left Arrow, Esc
- To see what method you are in right now:
- Put cursor on vertical indentation line
- Beginning of block appears at top of line
Cmd-U Goto superclass
Cmd-O Goto class (with checkbox for library classes too)
Cmd-Shift-O Goto file
Cmd-Opt-O Goto symbol (class, method, variable, CSS class, etc.
Shift,Shift Search everywhere (do all of the above gotos)
Ctrl-Tab Switch to another open editor/tool (easiest way to
toggle between 2 edit panes)
Cmd-Opt-Left Go back to where you were
Cmd-Opt-Right Go forward to where you were
Cmd-Shift-[ Move left one editor tab/window
Cmd-Shift-] Move right one editor tab/window
DblClick editor tab Maximize/restore editor window
Cmd-Shift-F12 Maximize/restore editor window
Ctrl-Up/Down Goto previous/next method
(No, Mac OS X Snow Leopard overrides for "Spaces")
Opt-Up/Down Goto previous/next method (Fred custom def)
- To define:
- Settings | IDE | Keymap
- Search for "Method" to find "Next Method" key def
- Dblclick key def line
- Add Keyboard Shortcut Opt-Down
- Allow it to delete the old meaning of the key
- Repeat for Opt-Up as Previous Method
Cmd-Opt-[ Goto start of block (if, for, etc.)
Cmd-Opt-] Goto end of block (if, for, etc.)
Cmd-L Goto line number
Cmd-Plus Expand code block
Cmd-Minus Collapse code block
Cmd-Shift-Backspace Goto most recent edit of any file
Cmd-E List of recently viewed files
Cmd-Shift-E List of recently edited files
Opt-Shift-C List of recent edit actions on all files (can revert)
F2 Goto next error
Shift-F2 Goto previous error
Hover Show details of current error
Cmd-F1 Show details of current error
F3 Toggle bookmark
Cmd-F3 Show bookmarks (and go to them, delete them, etc)
Opt-F3 Toggle bookmark (and specify a letter or number id)
Cmd-MouseOver Brief info about class, method, template name, etc
Opt-Space Quick description
Ctrl-J Quick doc (Up arrow button to see external docs)
F1 Quick doc (Up arrow button to see external docs)
Shift-F1 External doc
Cmd-P Show param info (within method call args)
Ctrl-H Class Tree (Inheritance)
Cmd-Shift-H Method Tree (Inheritance)
Ctrl-Opt-H Method Call Tree (buttons for caller or callee tree)
Ctrl-Space Code completion
Ctrl-Shift-Space Smart code completion
Ctrl-Opt-Space Class name completion (adding import if missing)
Cmd-Shift-Enter Statement completion
Opt-Enter Display intention actions (like clicking on lightbulb)
Ctrl-Enter Generate code (choose action from a popup)
Cmd-N Generate code (choose action from a popup)
Cmd-Opt-T Surround code with statement (if, for, try, etc.)
Cmd-J Insert Live Template
Cmd-Opt-J Surround code with Live Template
Cmd-/ Comment/uncomment
Tab Indent
Shift-Tab Undent
Cmd-Shift-U Toggle case
Cmd-C Copy
Cmd-V Paste
Cmd-Shift-V Paste from older paste buffers
Cmd-X Cut
Drag Select text
Opt-Drag Rectangular select text
Cmd-Shift-8 Toggle rectangular mode for select/cut/paste/copy
Cmd-F Find text
Cmd-G Find next
Cmd-Shift-G Find previous
Cmd-R Replace text
Cmd-Shift-F Find text in files
Cmd-Opt-Down Find next in files
Cmd-Opt-Up Find previous in files
Cmd-Shift-R Replace text in files
Cmd-Opt-F7 Show usages of variable in all files (popup)
Opt-F7 Find usages of variable in all file (in Find pane)
Cmd-F7 Find usages of variable in file
Cmd-Shift-F7 Highlight usages in file
Cmd-G Goto to next highlighted usage in file
Cmd-Shift-G Goto to previous highlighted usage in file
Shift-F6 Rename
Cmd-0 Event Log window
Cmd-1 Project window
Cmd-2 Favorites window
Cmd-3 Find window
Cmd-4 Database window
Cmd-5 Debug window
Cmd-6 TODO window
Cmd-7 Structure window
Ctrl-R Run app
Opt-R Run manage.py task
Ctrl-D Debug app
F7 Step into
F8 Step over
Shift-F8 Step out
Cmd-Opt-R Resume
Cmd-F8 Toggle breakpoint (or click in left margin)
Cmd-Shift-F8 View/manage breakpoints
Cmd-Opt-F8 Evaluate selected expression
Opt-F8 Evaluate expression (in a popup window)
Cmd-F2 Stop debugging
RightClick editor tab "Copy Path" in menu copies full filename
Useful menu actions
-------------------
- Window | Editor Tabs | Split Horizontally
- VCS | Local History | Show History
Settings/Modes
--------------
- Project | Gear icon in header:
- Autoscroll from source
- Autoscroll to source
- Show members (saves a lot of Cmd-F12 presses)
- Sort by type
- Structure | Gear icon in header:
- Autoscroll from source
- Preferences
- IDE
- Editor | Appearance
- Show method separators
- Show right margin
- Show line numbers
- Project
- Code Style | General | Right margin = 80 (was 120)
Complete Shortcut Key Lists
---------------------------
http://www.jetbrains.com/pycharm/docs/PyCharm_ReferenceCard_Mac.pdf
http://www.jetbrains.com/pycharm/docs/PyCharm_ReferenceCard.pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment