sublime text 2安装及使用

时间:2024-04-07 11:34:24

1、首先下载Sublime Text:http://www.sublimetext.com/

2、基本设置。參考此文:http://blog.jobbole.com/40660/

{
"auto_complete": false,
"caret_style": "solid",
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night-Eighties.tmTheme",
"draw_white_space": "all",
"ensure_newline_at_eof_on_save": true,
"file_exclude_patterns":
[
".DS_Store",
"*.pid",
"*.pyc"
],
"find_selected_text": true,
"fold_buttons": false,
"folder_exclude_patterns":
[
".git",
"__pycache__",
"env",
"env3"
],
"font_face": "Ubuntu Mono",
"font_options":
[
"subpixel_antialias",
"no_bold"
],
"font_size": 16.0,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
],
"line_padding_bottom": 0,
"line_padding_top": 0,
"rulers":
[
72,
79
],
"scroll_past_end": false,
"show_minimap": false,
"tab_size": 4,
"theme": "Soda Dark.sublime-theme",
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"wide_caret": true,
"word_wrap": true,
"wrap_width": 80
}

3、插件安装;

通用安装方法:打开sublime text2 -> Preferences -> Browse Packages。将从github上下载文件解压缩,并重命名为相应插件的名字放入目录就可以。

4、python插件安装SublimeREPL;

设置能直接执行当前文件:http://blog.sina.com.cn/s/blog_6476250d0101a881.html

(1)打开C:\Users\MyPC\AppData\Roaming\Sublime Text 2\Packages\SublimeREPL\config\Python\Main.sublime-menu文件找到"id": "repl_python"所在行,将这个JSON对象中args属性下cmd属性值改为["python",
"-i", "-u", "$file_basename"]

(2)点击Perferences-Key Bindings-Users。设置快捷键

[
{ "keys": ["f5"],
"caption": "SublimeREPL: Python",
"command": "run_existing_window_command", "args":
{ "id": "repl_python" ,
"file": "config/Python/Main.sublime-menu"
}
}
]

(3)安装pylint 和Pylinter插件

pip install pylint

5、其他

一些比較好的插件:http://ipestov.com/the-best-plugins-for-sublime-text/

      这两篇文章也能够看看:

http://www.xuanfengge.com/practical-collection-of-sublime-plug-in.html

http://www.xuanfengge.com/sublime-text-2-artifact.html

列编辑:Shift+鼠标右键拖动选中。鼠标中间滚轮这两种方式。