Mac PyCharm keyboard shortcuts ------------------------------ --Fred 10/4/2012 --Fred 11/10/2014 --Fred 5/3/2016 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-Delete Go back to where you last edited Cmd-Shift-[ Move left one editor tab/window Cmd-Shift-] Move right one editor tab/window Ctrl-Tab Pop up Switcher window to move among tabs and tools - Ctrl-Tab/Ctrl-Shift-Tab = next/prev tab/tool - Delete = Close tab/tool - Easiest way to toggle between 2 tabs DblClick editor tab Maximize/restore editor window Cmd-Shift-F12 Maximize/restore editor window Cmd-Click editor tab Navigate to folder/ancestor of tab's file in Finder 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 Shift-Scroll Scroll horizontally Cmd-Plus Expand code block Cmd-Minus Collapse code block Cmd-Shift-Plus Expand all code blocks Cmd-Shift-Minus Collapse all code blocks 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) In Databases pane, shows DESCRIBE and a few table rows In DB Table Editor, transposes rows and cols for easier viewing of wide rows. Hit 3 times for larger window. Shift-F1 External doc Opt-F1 Current method/property/class in various views (Project View, File Structure, Nav Bar, etc.) 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 Cmd-P Parameter list completion (type between parens) 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 Cmd-Opt-/ Block 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 Opt-Click Set multiple cursors for typing 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 Next page of rows in Database Table Editor Cmd-Opt-Up Find previous in files Previous page of rows in Database Table Editor 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 Ctrl-T List of available refactorings at current location 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 Cmd-Shift-C Copies full filename of the file being edited RightClick editor tab "Copy Path" in menu copies full filename Cmd-Click editor tab Dropdown to navigate to path or ancestor dir of file in native OS Finder/Explorer/whatever 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