-
Notifications
You must be signed in to change notification settings - Fork 0
/
ms-python.el
48 lines (41 loc) · 1.72 KB
/
ms-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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Python mode customizations
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(require 'python)
(add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
(add-to-list 'interpreter-mode-alist '("python" . python-mode))
(add-to-list 'load-path (expand-file-name "~/.emacs.d/emacs-ctable/"))
(add-to-list 'load-path (expand-file-name "~/.emacs.d/emacs-deferred/"))
(add-to-list 'load-path (expand-file-name "~/.emacs.d/emacs-epc/"))
(add-to-list 'load-path (expand-file-name "~/.emacs.d/emacs-jedi/"))
(require 'jedi)
(setq jedi:complete-on-dot t)
(setq jedi:server-command (list "python" jedi:server-script))
(defun ms-python-hook ()
(setq python-indent-offset 4)
(setq python-smart-indentation nil)
(setq indent-tabs-mode nil)
;;(highlight-beyond-fill-column)
(abbrev-mode)
;;(yas/advise-indent-function 'indent-for-tab-command)
(semantic-mode 1)
(jedi:setup)
(setq ac-sources '(ac-source-yasnippet
ac-source-jedi-direct
ac-source-features
ac-source-abbrev
ac-source-words-in-same-mode-buffers
))
(local-set-key (kbd "\C-c?") 'jedi:show-doc)
; (local-set-key (kbd "\C-cp") 'semantic-analyze-proto-impl-toggle)
; (local-set-key (kbd "\C-c \C-r") 'semantic-symref)
(local-set-key (kbd "\C-xj") 'jedi:goto-definition)
;(add-to-list 'ac-sources 'ac-source-gtags)
;(add-to-list 'ac-sources 'ac-source-semantic)
(local-set-key [(control return)] 'auto-complete)
)
(add-hook 'python-mode-hook 'ms-python-hook)
;; pymacs
;(require 'pymacs)
;(pymacs-load "ropemacs" "rope-")
;(setq ropemacs-enable-autoimport t)