-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpython.el
30 lines (25 loc) · 809 Bytes
/
python.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
;; Python
(require 'python)
(add-hook 'python-mode 'whitespace-mode)
(defun lookup-python-doc ()
(interactive)
(let (search-url keyword)
(setq keyword
(if (region-active-p)
(buffer-substring-no-properties (region-beginning) (region-end))
(thing-at-point 'symbol)))
(message "%s"
(setq search-url
(format
"file:///usr/share/doc/python-docs-2.7.5/html/search.html?q=%s&check_keywords=yes&area=default"
keyword)))
(browse-url search-url)))
(global-set-key (kbd "<f6>") 'lookup-python-doc)
(add-hook 'python-mode-hook
(lambda () (setq forward-sexp-function nil)))
(add-hook 'python-mode-hook
(lambda ()
(setq indent-tabs-mode nil)
(setq tab-width 4)
(setq python-indent-offset 4)))
(setq python-shell-interpreter "python3")