配置文件
Sublime Text 的一个优点就是它的所有配置都是简单的基于 JSON 的配置文件。这使得你可以很容易的将配置转到另一个系统中。我也见过一些人使用 Dropbox 自动同步他们所有电脑上的配置。
Preferences.sublime-settings 配置了 Sublimede 的显示和行为.你可以在sublime 中通过 Preferences > Settings — User 打开并编辑此文件。我使用如下配置:
{
// Colors
"color_scheme": "Packages/Tomorrow Color Schemes/Tomorrow-Night.tmTheme",
"theme": "Soda Dark.sublime-theme",
// Font
"font_face": "Ubuntu Mono",
"font_size": 16.0,
"font_options": ["subpixel_antialias", "no_bold"],
"line_padding_bottom": 0,
"line_padding_top": 0,
// Cursor style - no blinking and slightly wider than default
"caret_style": "solid",
"wide_caret": true,
// Editor view look-and-feel
"draw_white_space": "all",
"fold_buttons": false,
"highlight_line": true,
"auto_complete": false,
"show_minimap": false,
// Editor behavior
"scroll_past_end": false,
"highlight_modified_tabs": true,
"find_selected_text": true,
// Word wrapping - follow PEP 8 recommendations
"rulers": [ 72, 79 ],
"word_wrap": true,
"wrap_width": 80,
// Whitespace - no tabs, trimming, end files with \n
"tab_size": 4,
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"ensure_newline_at_eof_on_save": true,
// Sidebar - exclude distracting files and folders
"file_exclude_patterns":
[
".DS_Store",
"*.pid",
"*.pyc"
],
"folder_exclude_patterns":
[
".git",
"__pycache__",
"env",
"env3"
]
}
Pylinter.sublime-settings配置了pylinter 插件。我使用下面的配置让 Pyhton 在保存时自动规范,并对违反规范显示图标。
{
// Configure pylint's behavior
"pylint_rc": "/Users/daniel/dev/pylintrc",
// Show different icons for errors, warnings, etc.
"use_icons": true,
// Automatically run Pylinter when saving a Python document
"run_on_save": true,
// Don't hide pylint messages when moving the cursor
"message_stay": true
}