zenmbu 发表于 2015-12-15 11:18:30

Python开发工具PyCharm个性化设置

1.设置默认PyCharm解析器:
操作如下:
Python–>Preferences–>Project Interpreter–>Python Interpreter 点击“+”号选择系统安装的Python。
http://www.unixdo.com/content/uploadfile/201502/6f66466ca584e53d5bb5336891d2dbb220150214041947.jpg
然后再返回Project Interpreter,选择刚添加的解释器。
http://www.unixdo.com/content/uploadfile/201502/fee124fddbda759a9c589e5182ec994420150214041947.jpg

2.设置缩进符为制表符“Tab”
File -> Default Settings -> Code Style
-> General -> 勾选“Use tab character”
-> Python -> 勾选“Use tab character”
-> 其他的语言代码同理设置
3.设置IDE皮肤主题
File -> Settings -> IDE Settings -> Appearance -> Theme -> 选择“Alloy.IDEA Theme”
4.显示“行号”与“空白字符”
File -> Settings -> IDE Settings -> Editor -> Appearance
-> 勾选“Show line numbers”、“Show whitespaces”、“Show method separators”
5.设置编辑器“颜色与字体”主题
File -> Settings -> IDE Settings -> Editor -> Colors & Fonts -> Scheme name -> 选择“Darcula”
说明:先选择“Darcula”,再“Save As”一份,命名为“qianyunlai.com”,因为默认的主题是“只读的”,一些字体大小颜色什么的都不能修改,拷贝一份后方可修改!
http://www.unixdo.com/content/uploadfile/201502/aef1db6bc375035c8eed983631ef375d20150214041947.jpg
修改字体大小
File -> Settings -> IDE Settings -> Editor -> Colors & Fonts -> Font -> Size -> 设置为“14”
6.去掉默认折叠
File -> Settings -> IDE Settings -> Editor -> Code Folding -> Collapse by default -> 全部去掉勾选
7.“代码自动完成”时间延时设置
File -> Settings -> IDE Settings -> Editor -> Code Completion
-> Auto code completion in (ms):0
-> Autopopup in (ms):500
http://www.unixdo.com/content/uploadfile/201502/ce73317b0b7f0158d2f04ba9a9bf653620150214041948.png
8.修改IDE快捷键方案
File -> Settings -> IDE Settings -> Keymap
系统自带了好几种快捷键方案,下拉框中有如“defaul”,“Visual Studio”,在查找Bug时非常有用,“NetBeans 6.5”,“Default for GNOME”等等可选项,
因为“Eclipse”方案比较大众,个人用的也比较多,最终选择了“Eclipse”。
还是有几个常用的快捷键跟Eclipse不一样,为了能修改,还得先对Eclipse方案拷贝一份:
(1).代码提示功能,默认是【Ctrl+空格】,现改为跟Eclipse一样,即【Alt+/】
Main menu -> code -> Completion -> Basic -> 设置为“Alt+/”
Main menu -> code -> Completion -> SmartType -> 设置为“Alt+Shift+/”
不过“Alt+/”默认又被
Main menu -> code -> Completion -> Basic -> Cyclic Expand Word 占用,先把它删除再说吧(单击右键删除)!
http://www.unixdo.com/content/uploadfile/201502/a11f2e418948108249f6184733a38a6520150214041948.jpg
(2).关闭当前文档,默认是【Ctrl+F4】,现改为跟Eclipse一样,即【Ctrl+W】
Main menu -> Window -> Active Tool Window -> Close Active Tab -> 设置为 “Ctrl+F4”;
Main menu -> Window -> Editor -> Close -> 设置为 “Ctrl+W”;
http://www.unixdo.com/content/uploadfile/201502/379339f16bbd81b8606c4b445ae7922420150214041948.jpg
http://www.unixdo.com/content/uploadfile/201502/6a138bbffe11d8d243809fbead0022d120150214041948.png
pycharm修改代码模板支持中文输出

python默认不支持中文输出,需要在py的开头添加

#coding: utf-8

在pycharm里面,选项,ide settings,file and code templates,选择python script,添加#coding: utf-8即可。
页: [1]
查看完整版本: Python开发工具PyCharm个性化设置