关闭

Emacs下配置Python IDE环境

2200人阅读 评论(0) 收藏 举报

本文部分参考转自:http://www.byywee.com/page/M0/S211/211203.html


扩展工具:

Snippet: 可定义模板;
AutoComplete:自动完成工具,可以弹出列表框以供选择;
Rope and Ropemacs: 重构工具,如 extract method, goto difinition, show documents  等等
pycomplete:智能提示工具,如,输入time.cl 按TAB,会列出time模块全部以cl开头的函数。调用函数时,可以通过mini buffer提示函数的参数类型。

1. Install YASnippet

download:
https://github.com/capitaomorte/yasnippet

install:
cp top-folder-of-yasinppet to your emcas load-path

config:
(add-to-list'load-path "d:/tools/emacs-23.2/config/.emacs.d/capitaomorte-yasnippet-dad9612")
(require 'yasnippet) 
(yas/initialize) 
(yas/load-directory "d:/tools/emacs-23.2/config/.emacs.d/capitaomorte-yasnippet-dad9612/snippets")

2. Install AutoComplete:

download:
http://cx4a.org/software/auto-complete/#Latest_Stable

install:
cp top-folder-of-autocomplete to your emcas load-path

config:
(add-to-list'load-path "d:/tools/emacs-23.2/config/.emacs.d/auto-complete-1.3.1")
(require 'auto-complete) 
(require 'auto-complete-config) 
;(require 'auto-complete-settings) ; for test here.
(global-auto-complete-mode t) 
(add-to-list 'ac-dictionary-directories "d:/tools/emacs-23.2/config/.emacs.d/auto-complete-1.3.1/dict")
;(ac-config-default) ; for test here
(setq-default ac-sources '(ac-source-words-in-same-mode-buffers)) 
(add-hook 'emacs-lisp-mode-hook (lambda () (add-to-list 'ac-sources 'ac-source-symbols))) 
(add-hook 'auto-complete-mode-hook (lambda () (add-to-list 'ac-sources 'ac-source-filename))) 
(set-face-background 'ac-candidate-face "lightgray") 
(set-face-underline 'ac-candidate-face "darkgray") 
(set-face-background 'ac-selection-face "steelblue") 
(define-key ac-completing-map "\M-n" 'ac-next) 
(define-key ac-completing-map "\M-p" 'ac-previous) 
(setq ac-auto-start 1) 
(setq ac-dwim t) 
(define-key ac-mode-map (kbd "M-TAB") 'auto-complete) 

3. Install rope, pymacs and ropemacs

download rope:
http://pypi.python.org/pypi/rope

install rope:
python setup.py install

config rope:
no need

download pymacs:
https://github.com/pinard/Pymacs/downloads

install pymacs:

for python part:
python pppp -C ppppconfig.py pppp.rst.in pymacs.el.in pymacs.rst.in Pymacs.py.in contrib tests
python setup.py install

for emacs part:
cp top-folder-of-pymacs\pymacs.el your-eamcs-load-path(for me, is d:\tools\emacs-23.2\config\.emacs.d\pymacs\)

config pymacs:
(add-to-list'load-path "d:/tools/emacs-23.2/config/.emacs.d/pymacs")
(require 'pymacs)
(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) 

download ropemacs:
http://bitbucket.org/agr/ropemacs/get/tip.gz

install ropemacs:

python  setup.py install

install repemode:
( must install repemode for ropemacs, which can be download from http://bitbucket.org/agr/ropemode/get/tip.gz)
python setup.py install


config ropemacs:
(require 'pymacs)
(pymacs-load "ropemacs" "rope-") 
(setq ropemacs-enable-autoimport t)

To chech pymacs and ropemacs sussfully:

luanch eamcs, and within the *Pymacs* buffer, you can info such like this:

<23 (version "0.24-beta2")
>45 eval pymacs_load_helper("ropemacs", "rope-")
<5801 (eval (progn (defgroup ropemacs nil
  "ropemacs, an emacs plugin for rope."
  :link '(url-link "http://rope.sourceforge.net/ropemacs.html")
  :prefix "rope-")
......

4. Install pycomplete:

download:
http://www.rwdev.eu/articles/emacspyeng

install and config:
refer to http://www.rwdev.eu/articles/emacspyeng

5. config gdb

to continue.

0
0

猜你在找
【视频】C语言及程序设计(讲师:贺利坚)
【视频】Python爬虫工程师培养课程全套(讲师:韦玮)
【视频】Python全栈开发入门与实战(讲师:李杰)
【视频】2017软考网络规划设计师套餐(讲师:任铄)
【视频】2017软考软件设计师套餐(讲师:任铄)
【视频】2017软考信息系统项目管理师套餐(讲师:任铄)
【视频】软考(高级)项目经理实战营(讲师:张传波)
【视频】微信公众平台开发套餐(讲师:刘运强)
深度学习原理+实战+算法+主流框架套餐(讲师:唐宇迪)
2017系统集成项目管理工程师通关套餐(讲师:徐朋)
查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:18430次
    • 积分:303
    • 等级:
    • 排名:千里之外
    • 原创:9篇
    • 转载:7篇
    • 译文:0篇
    • 评论:0条
    文章分类