python korea(emacs)

76
Emacs for Python Programming Johnny Cho( 조민재 ) @popeye92 June 29th, 2014

Upload: johnny-cho-

Post on 23-Jun-2015

1.624 views

Category:

Documents


0 download

DESCRIPTION

Emacs for python programmers in Python Korea Community seminar. Mostly derived from Vinod Kurup's material

TRANSCRIPT

Page 1: Python korea(emacs)

Emacs for Python Programming

Johnny Cho( 조민재 )

@popeye92

June 29th, 2014

Page 2: Python korea(emacs)

First ...

Page 3: Python korea(emacs)

Special thanks to Vinod Kurup

Page 4: Python korea(emacs)

But first ...

Page 5: Python korea(emacs)
Page 6: Python korea(emacs)

How to safely play with Emacs

• Control-x Control-c to quit (C-x C-c)

• C-g is your friend

• Plan to mess up

vinod:~$ rm -r .emacs.d .emacs

vinod:~$ emacs

You're good to go again!

Page 7: Python korea(emacs)

Emacs Sucks!

but only if you use the default settings

Page 8: Python korea(emacs)

Emacs Tutorial

C-h t RET

M-x help-with-toturial-spec-language RET Korean RET

Page 9: Python korea(emacs)

Emacs Starter Kit

M -x package-install RET starter-kit RET

Page 10: Python korea(emacs)

Packages for Emacs python programmers

ido-settings.el;

auto-complete;

jedi.el;

flycheck;

autopair;

optional ipython;

Page 11: Python korea(emacs)

Installation Packages

(require 'package)

(setq package-archives '(("gnu" . "http://elpa.gnu.org/packages/")

("marmalade" . "http://marmalade-repo.org/packages/")

("melpa" . "http://melpa.milkbox.net/packages/")))

Page 12: Python korea(emacs)

Installation Packages

M-x package-list-packages

M-x package-install RET autopair RET

Page 13: Python korea(emacs)

Emacs Python IDE

Page 14: Python korea(emacs)

Features

• Syntax highlighting

• Auto-Indentation

• Code completion

• Documentation lookup

• Code lookup / navigation

• Error highlighting (on-the-fly)

• Code runner

• Test runner

• Debugging

Page 15: Python korea(emacs)

Major mode

Python's is a bit of a mess

Page 16: Python korea(emacs)

Use python-mode.el

M-x package-install RET python-mode RET ( < Emacs24.2 )

Emacs24 .2 이후기본패키지

Page 17: Python korea(emacs)

Syntax highlighting

Page 18: Python korea(emacs)
Page 19: Python korea(emacs)
Page 20: Python korea(emacs)

Automatic indentation

Page 21: Python korea(emacs)
Page 22: Python korea(emacs)
Page 23: Python korea(emacs)
Page 24: Python korea(emacs)
Page 25: Python korea(emacs)

Code completion

Page 26: Python korea(emacs)
Page 27: Python korea(emacs)
Page 28: Python korea(emacs)
Page 29: Python korea(emacs)
Page 30: Python korea(emacs)
Page 31: Python korea(emacs)
Page 32: Python korea(emacs)

Documentation lookup

Page 33: Python korea(emacs)
Page 34: Python korea(emacs)
Page 35: Python korea(emacs)
Page 36: Python korea(emacs)

Code lookup

Page 37: Python korea(emacs)
Page 38: Python korea(emacs)

Error highlighting

Page 39: Python korea(emacs)
Page 40: Python korea(emacs)
Page 41: Python korea(emacs)

Code runner

• Send the current buffer to Python

C-c C-c

• Choose your interpreter

(setq python-python-command "ipython")

• Choose your virtualenv

(virtualenv-workon "myproject")

or

M-x virtualenv-workon RET myproject RET

Page 42: Python korea(emacs)

Test runner

Page 43: Python korea(emacs)
Page 44: Python korea(emacs)
Page 45: Python korea(emacs)
Page 46: Python korea(emacs)
Page 47: Python korea(emacs)
Page 48: Python korea(emacs)
Page 49: Python korea(emacs)

Debugging

Page 50: Python korea(emacs)
Page 51: Python korea(emacs)

Useful links

Python Programming in Emacs● www.emacswiki.org/emacs/PythonProgrammingInEmacs● wiki.python.org/moin/EmacsEditor

Page 52: Python korea(emacs)

Non-python stuffs

Page 53: Python korea(emacs)

Magit mode

Page 54: Python korea(emacs)
Page 55: Python korea(emacs)
Page 56: Python korea(emacs)
Page 57: Python korea(emacs)
Page 58: Python korea(emacs)
Page 59: Python korea(emacs)
Page 60: Python korea(emacs)
Page 61: Python korea(emacs)

Dired mode

Page 62: Python korea(emacs)
Page 63: Python korea(emacs)
Page 64: Python korea(emacs)

Keyboard Macros

Page 65: Python korea(emacs)
Page 66: Python korea(emacs)
Page 67: Python korea(emacs)

Pretty Themes

Page 68: Python korea(emacs)
Page 69: Python korea(emacs)
Page 70: Python korea(emacs)
Page 71: Python korea(emacs)

Shell modes

Page 72: Python korea(emacs)
Page 73: Python korea(emacs)
Page 74: Python korea(emacs)

And more!!

• Kill ring

• yasnippet

• Org-mode

• ace-jump

• erc

Page 75: Python korea(emacs)

Help in emacs

• C-h t => tutorial

• C-h f => function docs

• C-h v => variable docs

• C-h k => keybindings

Emacs can teach you emacs

Page 76: Python korea(emacs)

감사합니다 .

[email protected]@popeye92