Skip to content

Instantly share code, notes, and snippets.

@arocks arocks/Emacs-Python
Created Apr 25, 2015

Embed
What would you like to do?
Outline of my lightning talk "Emacs and Python" at Bangpypers April 2015
# Emacs and Python
## Why?
## Intro
- Arun Ravindran <arunrocks.com> @arocks
- Emacs user for 15 years
- Python user for 13 years
- Author of "Django Design Patterns and Best Practices"
## Emacs
### Your package manager Emacs 24 or beta
1. On Arch: $ sudo pacman -S emacs
### Config is in `~/.emacs.d/init.el`
### M-x means Alt+x
### C-x means Ctrl+x (or Caps+x ?)
## ElPy
### Elpy >= Python mode+Rope+PyLint+many more
```
Installation
Emacs: M-x package install ENTER elpy
Then in your init.el
(elpy-enable)
;; Your virtual environment?
Takes 5 mins... you are welcome!
```
### Keyboard shortcuts
1. C-c C-c - Evaluate region/buffer by sending to inferior python
2. C-c C-d - Show documentation at cursor symbol
3. M-. - Go to definition (better than docs for Django)
- https://github.com/DjangoPatternsBook/superbook/blob/chapter03/src/profiles/models.py
4. C-c C-o - Show class/fn definitions in buffer as Occur window
5. C-UP/DN - Jump to prev class definition line (corresp for C-DOWN)
6. M-LF/RT - Move indented block starting from line where cursor is RIGHT(indent) or LEFT(unindent
@arocks

This comment has been minimized.

Copy link
Owner Author

commented Apr 25, 2015

Emacs and Python

Why?

Intro

  • Arun Ravindran <arunrocks.com> @arocks
  • Emacs user for 15 years
  • Python user for 13 years
  • Author of "Django Design Patterns and Best Practices"

Emacs

Your package manager Emacs 24 or beta

  1. On Arch: $ sudo pacman -S emacs

Config is in ~/.emacs.d/init.el

M-x means Alt+x

C-x means Ctrl+x (or Caps+x ?)

ElPy

Elpy >= Python mode+Rope+PyLint+many more

Installation

Emacs: M-x package install ENTER elpy

Then in your init.el

(elpy-enable)
;; Your virtual environment?

Takes 5 mins... you are welcome!

Keyboard shortcuts

  1. C-c C-c - Evaluate region/buffer by sending to inferior python
  2. C-c C-d - Show documentation at cursor symbol
  3. M-. - Go to definition (better than docs for Django)
  1. C-c C-o - Show class/fn definitions in buffer as Occur window
  2. C-UP/DN - Jump to prev class definition line (corresp for C-DOWN)
  3. M-LF/RT - Move indented block starting from line where cursor is RIGHT(indent) or LEFT(unindent)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.