conf-python.el 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ;;(add-to-list 'load-path (in-modes-d "python.el"))
  2. (require 'python)
  3. (add-hook 'python-mode-hook
  4. (lambda ()
  5. (setq indent-tabs-mode nil)
  6. (setq python-indent-offset 4)
  7. (setq tab-width 4)))
  8. (add-hook 'python-mode-hook
  9. '(lambda ()
  10. (define-key python-mode-map [(control ?c) ?l] 'pylookup-lookup)
  11. (local-set-key (kbd "C-c #") 'comment-or-uncomment-region)))
  12. ; run redgreen in current project
  13. (require 'redgreen-at-project-root)
  14. (add-hook 'python-mode-hook
  15. '(lambda ()
  16. (define-key python-mode-map [(control ?c) ?r] 'redgreen-at-project-root)))
  17. ; python-auto-super
  18. (require 'python-auto-super)
  19. (add-hook 'python-mode-hook
  20. '(lambda ()
  21. (define-key python-mode-map [(control ?c) ?s] 'python-auto-super)))
  22. ; python-auto-import
  23. (require 'python-auto-import)
  24. (add-hook 'python-mode-hook
  25. '(lambda ()
  26. (define-key python-mode-map [(control ?c) ?i] 'python-auto-import)))
  27. ;(ac-ropemacs-initialize)
  28. ;(add-hook 'python-mode-hook
  29. ; (lambda ()
  30. ; (add-to-list 'ac-sources 'ac-source-ropemacs)))
  31. (add-to-list 'auto-mode-alist '("\\.py\\'" . python-mode))
  32. ;; Initialize Pymacs
  33. ;(load-file "~/.emacs.d/elpa/pymacs-0.25/pymacs.el")
  34. ;(require 'pymacs)
  35. ;(autoload 'pymacs-apply "pymacs")
  36. ;(autoload 'pymacs-call "pymacs")
  37. ;(autoload 'pymacs-eval "pymacs" nil t)
  38. ;(autoload 'pymacs-exec "pymacs" nil t)
  39. ;(autoload 'pymacs-load "pymacs" nil t)
  40. ;; Initialize Rope
  41. ;(pymacs-load "ropemacs" "rope-")
  42. ;(setq ropemacs-enable-autoimport t)
  43. (provide 'conf-python)