如果使用Archlinux的話,可以直接通過yaourt查找這些插件,都可以直接安裝的。
python setup.py install
./configure & make & make install
注意:pymacs可能和python2.5不兼容,我原來裝的是2.5后來因為pamacs用不了,不得不換回2.4
;;這里路徑換為你自己的lisp目錄,可以使用emacs-lisp-byte-compile命令編譯之后再加載
(load "/usr/share/emacs/site-lisp/site-start.d/python-mode.el")
(add-to-list 'load-path "/usr/share/emacs/site-lisp/site-start.d/pymacs.el")
;;load pydb
(require 'pydb)
(autoload 'pydb "pydb" "Python Debugger mode via GUD and pydb" t)
;;load pymacs
(autoload 'pymacs-load "pymacs" nil t)
(autoload 'pymacs-eval "pymacs" nil t)
(autoload 'pymacs-apply "pymacs")
(autoload 'pymacs-call "pymacs")
(require 'pycomplete)
(autoload 'py-complete-init "py-complete")
(add-hook 'python-mode-hook 'py-complete-init)
(autoload 'jython-mode "python-mode" "Python editing mode." t)
(autoload 'py-shell "python-mode" "Start an interactive Python interpreter in another window." t)
(autoload 'doctest-mode "doctest-mode" "Editing mode for Python Doctest examples." t)
(autoload 'py-complete "pycomplete" "Complete a symbol at point using Pymacs." t)
(add-to-list 'auto-mode-alist '("\\.py$" . python-mode))
(add-to-list 'auto-mode-alist '("\\.doctest$" . doctest-mode))
(add-to-list 'interpreter-mode-alist '("python" . python-mode))
(add-to-list 'interpreter-mode-alist '("jython" . jython-mode))
;;define some keys
(require 'comint)
(define-key comint-mode-map [(meta p)]
'comint-previous-matching-input-from-input)
(define-key comint-mode-map [(meta n)]
'comint-next-matching-input-from-input)
(define-key comint-mode-map [up]
'comint-next-input)
(define-key comint-mode-map [down]
'comint-previous-input)
;;set ipython as the shell
(setq ipython-command "/usr/bin/ipython")
(require 'ipython)
(load-library "pylint")
;; use flymake with pylint
(when (load "flymake" t)
(defun flymake-pylint-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 "epylint" (list local-file))))
(add-to-list 'flymake-allowed-file-name-masks
'("\\.py\\'" flymake-pylint-init)))