-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-python.el
More file actions
76 lines (62 loc) · 2.8 KB
/
setup-python.el
File metadata and controls
76 lines (62 loc) · 2.8 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
(require 'ipython)
(autoload 'python-mode "python-mode" "Python Mode." t)
(autoload 'pymacs-apply "pymacs")
(autoload 'pymacs-call "pymacs")
(autoload 'pymacs-eval "pymacs" nil t)
(autoload 'pymacs-exec "pymacs" nil t)
(autoload 'pymacs-load "pymacs" nil t)
(autoload 'pylookup-lookup "pylookup")
(autoload 'pylookup-update "pylookup")
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(add-to-list 'interpreter-mode-alist '("python" . python-mode))
;; (add-hook 'python-mode-hook
;; (lambda ()
;; ;;(set-variable 'py-indent-offset 4)
;; ;;(set-variable 'py-smart-indentation nil)
;; (set-variable 'indent-tabs-mode nil)
;; (define-key py-mode-map (kbd "RET") 'newline-and-indent)
;; (define-key py-mode-map [tab] 'indent-for-tab-command)
;; (define-key py-mode-map (kbd "C-<tab>") 'yas/expand)
;; (setq yas/after-exit-snippet-hook 'indent-according-to-mode)
;; ;;(smart-operator-mode-on)
;; ))
;; pymacs
;;(eval-after-load "pymacs"
;; '(add-to-list 'pymacs-load-path YOUR-PYMACS-DIRECTORY"))
(pymacs-load "ropemacs" "rope-")
(setq ropemacs-enable-autoimport t)
;; Auto Syntax Error Hightlight
;; (when (load "flymake" t)
;; (defun flymake-pyflakes-init ()
;; (let* ((temp-file (flymake-init-create-temp-buffer-copy
;; 'flymake-create-temp-inplace))
;; (local-file (file-relative-name
;; temp-file
;; (file-name-directory buffer-file-name))))
;; (list "pyflakes" (list local-file))))
;; (add-to-list 'flymake-allowed-file-name-masks
;; '("\\.py\\'" flymake-pyflakes-init)))
;; (add-hook 'find-file-hook 'flymake-find-file-hook)
;; (add-hook 'python-mode-hook
;; #'(lambda ()
;; (push '(?' . ?')
;; (getf autopair-extra-pairs :code))
;; (setq autopair-handle-action-fns
;; (list #'autopair-default-handle-action
;; #'autopair-python-triple-quote-action))))
;; setup pylookup
(setq pylookup-program "~/bin/pylookup.py")
(setq pylookup-db-file "~/bin/pylookup.db")
(global-set-key "\C-ch" 'pylookup-lookup)
;; setup anything.el
;; (require 'anything)
;; (require 'anything-ipython)
;; (require 'anything-ipython)
;; (add-hook 'python-mode-hook #'(lambda ()
;; (define-key py-mode-map (kbd "M-<tab>") 'anything-ipython-complete)))
;; (add-hook 'ipython-shell-hook #'(lambda ()
;; (define-key py-mode-map (kbd "M-<tab>") 'anything-ipython-complete)))
;; (when (require 'anything-show-completion nil t)
;; (use-anything-show-completion 'anything-ipython-complete
;; '(length initial-pattern)))
(provide 'setup-python)