Skip to content

Instantly share code, notes, and snippets.

@arocks
Created April 25, 2015 18:08
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arocks/2db1cc3d8c17b451d92a to your computer and use it in GitHub Desktop.
Save arocks/2db1cc3d8c17b451d92a to your computer and use it in GitHub Desktop.
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
Copy link
Author

arocks 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