Skip to content

Latest commit

 

History

History
70 lines (61 loc) · 2.03 KB

python-mode-keys.org

File metadata and controls

70 lines (61 loc) · 2.03 KB

## Old:

  • M-; comment-line
  • C-q jedi:show-doc
  • M-. jedi:goto-definition
  • M-, jedi:goto-definition-pop-marker
  • C-c C-n flymake-goto-next-error
  • C-M-a Move to beginning of current or preceding defun (beginning-of-defun).
  • C-M-e Move to end of current or following defun (end-of-defun).
  • C-M-h Put region around whole current or following defun (mark-defun).
  • C-c C-c execute file in terminal
  • M-left python-indent-shift-left
  • M-right python-indent-shift-right

## Default:

  • C-c C-f (python-eldoc-at-point)
  • C-c C-j (imenu)
  • C-c C-r after run-python -> python-shell-send-region
  • C-c C-s after run-python -> python-shell-send-string
  • C-c C-v (python-check)
  • M-? (xref-find-references) - for symbol at cursor
  • M-. (xref-find-definitions) - for symbol at cursor
  • M-, (xref-go-back)
  • C-M-, (xref-go-forward)
  • C-M-u backward-up-list - go to first line of current block
  • M-x pdb Debugger
  • C-x C-a Debugger keys prefix

## New:

Custom common:

  • M-; (comment-line)
  • C-; (comment-dwim)
  • C-c C-k (beginning-of-defun)
  • C-c C-n (end-of-defun)
  • C-M-u (backward-up-list) - by dafult
  • C-c h (mark-defun)
  • C-c i (demap-toggle)
  • C-c j (mc/mark-all-like-this-dwim)

Custom Python mode:

  • C-c c (run-python) - on remote machine
  • C-c C-c execute file in terminal (my/exec-python)
  • C-c l/f (python-indent-shift-left) / (python-indent-shift-right)
  • C-c C-o (python-sort-imports)

Custom Eglot

  • M-i (my/eldoc) - show description in separate window only
  • C-’ (flymake-goto-next-error)
  • M-’ (flymake-goto-prev-error)
  • C-c C-e (eglot-rename)
  • C-c o (eglot-format) - region or entire buffer

May be useful:

  • M-x treesit-check-indent

Templates available with

  • M-x python-skl…
  • M-x python-skeleton…
  • and with TAB starting with “0”

All programming modes keys:

  • M-; ‘comment-line
  • C-; ‘comment-dwim
  • C-c k ‘beginning-of-defun
  • C-c n ‘end-of-defun
  • C-c h ‘mark-defun
  • C-c C-n ‘my/go-to-next-occurrence - to next word occurance or next header
  • C-c C-p ‘my/go-to-prev-occurrence