sublime text 配置文件

Posted zhmlzhml

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sublime text 配置文件相关的知识,希望对你有一定的参考价值。

不慌.

上网上下的clang全是报错,所以就想先配置一下文件.

其实它本来的配置我觉得挺好的.

可能因人而异有些地方还是改了改.

原版有英语注释的,就当是学英语了

  1 // While you can edit this file, it‘s best to put your changes in
  2 
  3 // "User/Preferences.sublime-settings", which overrides the settings in here.
  4 //
  5 // Settings may also be placed in file type specific options files, for
  6 // example, in Packages/Python/Python.sublime-settings for python files.
  7 {
  8     // Sets the colors used within the text area
  9     //主题文件
 10     "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
 11 
 12     // Note that the font_face and font_size are overriden in the platform
 13     // specific settings file, for example, "Preferences (Linux).sublime-settings".
 14     // Because of this, setting them here will have no effect: you must set them
 15     // in your User File Preferences.
 16     //字体样式、大小
 17     "font_face": "",
 18     "font_size": 10,
 19 
 20     // Valid options are "no_bold", "no_italic", "no_antialias", "gray_antialias",
 21     // "subpixel_antialias", "no_round" (OS X only) and "directwrite" (Windows only)
 22     // 字体选项:no_bold不显示粗体字,no_italic不显示斜体字,no_antialias和no_antialias关闭反锯齿
 23     // subpixel_antialias和no_round是OS X系统独有的
 24     // directwrite是Windows系统独有的
 25     "font_options": [],
 26 
 27     // Characters that are considered to separate words
 28     // 在文字上双击会全选当前的内容,如果里面出现以下字符,就会被截断
 29     "word_separators": "./\()"‘-:,.;<>~!@#$%^&*|+=[]{}`~?",
 30 
 31     // Set to false to prevent line numbers being drawn in the gutter
 32     // 是否显示行号
 33     "line_numbers": true,
 34 
 35     // Set to false to hide the gutter altogether
 36     // 是否显示行号边栏
 37     "gutter": true,
 38 
 39     // Spacing between the gutter and the text
 40     // 行号边栏和文字的间距
 41     "margin": 4,
 42 
 43     // Fold buttons are the triangles shown in the gutter to fold regions of text
 44     // 是否显示代码折叠按钮
 45     "fold_buttons": true,
 46 
 47     // Hides the fold buttons unless the mouse is over the gutter
 48     // 不管鼠标在不在行号边栏,代码折叠按钮一直显示
 49     "fade_fold_buttons": true,
 50 
 51     // Columns in which to display vertical rulers
 52     //列显示垂直标尺,在中括号里填入数字,宽度按字符计算
 53     "rulers": [],
 54 
 55     // Set to true to turn spell checking on by default
 56     // 是否打开拼写检查
 57     "spell_check": false,
 58 
 59     // The number of spaces a tab is considered equal to
 60     // Tab键制表符宽度
 61     "tab_size": 4,
 62 
 63     // Set to true to insert spaces when tab is pressed
 64     // 设为true时,缩进和遇到Tab键时使用空格替代
 65     "translate_tabs_to_spaces": false,
 66 
 67     // If translate_tabs_to_spaces is true, use_tab_stops will make tab and
 68     // backspace insert/delete up to the next tabstop
 69     // translate_tabs_to_spaces设置为true,Tab和Backspace的删除/插入作用于制表符宽度
 70     // 否则作用于单个空格
 71     "use_tab_stops": true,
 72 
 73     // Set to false to disable detection of tabs vs. spaces on load
 74     // false时禁止在载入的时候检测制表符和空格
 75     "detect_indentation": true,
 76 
 77     // Calculates indentation automatically when pressing enter
 78     // 按回车时,自动与制表位对齐
 79     "auto_indent": true,
 80 
 81     // Makes auto indent a little smarter, e.g., by indenting the next line
 82     // after an if statement in C. Requires auto_indent to be enabled.
 83     //针对C语言的
 84     "smart_indent": true,
 85 
 86     // Adds whitespace up to the first open bracket when indenting. Requires
 87     // auto_indent to be enabled.
 88     // 需要启用auto_indent,第一次打开括号缩进时插入空格?(没测试出来效果…)
 89     "indent_to_bracket": false,
 90 
 91     // Trims white space added by auto_indent when moving the caret off the
 92     // line.
 93     // 显示对齐的白线是否根据回车、tab等操作自动填补
 94     "trim_automatic_white_space": true,
 95 
 96     // Disables horizontal scrolling if enabled.
 97     // May be set to true, false, or "auto", where it will be disabled for
 98     // source code, and otherwise enabled.
 99     // 是否自动换行,如果选auto,需要加双引号
100     "word_wrap": "auto",
101 
102     // Set to a value other than 0 to force wrapping at that column rather than the
103     // window width
104     // 设置窗口内文字区域的宽度
105     "wrap_width": 0,
106 
107     // Set to false to prevent word wrapped lines from being indented to the same
108     // level
109     // 防止被缩进到同一级的字换行
110     "indent_subsequent_lines": true,
111 
112     // Draws text centered in the window rather than left aligned
113     // 如果没有定义过,则文件居中显示(比如新建的文件)
114     "draw_centered": false,
115 
116     // Controls auto pairing of quotes, brackets etc
117     // 自动匹配引号,括号等
118     "auto_match_enabled": true,
119 
120     // Word list to use for spell checking
121     // 拼写检查的单词列表路径
122     "dictionary": "Packages/Language - English/en_US.dic",
123 
124     // Set to true to draw a border around the visible rectangle on the minimap.
125     // The color of the border will be determined by the "minimapBorder" key in
126     // the color scheme
127     // 代码地图的可视区域部分是否加上边框,边框的颜色可在配色方案上加入minimapBorder键
128     "draw_minimap_border": false,
129 
130     // If enabled, will highlight any line with a caret
131     // 突出显示当前光标所在的行
132     "highlight_line": false,
133 
134     // Valid values are "smooth", "phase", "blink", "wide" and "solid".、
135     // 设置光标闪动方式
136     "caret_style": "smooth",
137 
138     // Set to false to disable underlining the brackets surrounding the caret
139     // 是否特殊显示当前光标所在的括号、代码头尾闭合标记
140     "match_brackets": true,
141 
142     // Set to false if you‘d rather only highlight the brackets when the caret is
143     // next to one
144     // 设为false时,只有光标在括号或头尾闭合标记的两端时,match_brackets才生效
145     "match_brackets_content": true,
146 
147     // Set to false to not highlight square brackets. This only takes effect if
148     // match_brackets is true
149     // 是否突出显示圆括号,match_brackets为true生效
150     "match_brackets_square": true,
151 
152     // Set to false to not highlight curly brackets. This only takes effect if
153     // match_brackets is true
154     // 是否突出显示大括号,match_brackets为true生效
155     "match_brackets_braces": true,
156 
157     // Set to false to not highlight angle brackets. This only takes effect if
158     // match_brackets is true
159     // 是否突出显示尖括号,match_brackets为true生效
160     "match_brackets_angle": false,
161 
162     // Enable visualization of the matching tag in html and XML
163     // html和xml下突出显示光标所在标签的两端,影响HTML、XML、CSS等
164     "match_tags": true,
165 
166     // Highlights other occurrences of the currently selected text
167     // 全文突出显示和当前选中字符相同的字符
168     "match_selection": true,
169 
170     // Additional spacing at the top of each line, in pixels
171     // 设置每一行到顶部,以像素为单位的间距,效果相当于行距
172     "line_padding_top": 0,
173 
174     // Additional spacing at the bottom of each line, in pixels
175     // 设置每一行到底部,以像素为单位的间距,效果相当于行距
176     "line_padding_bottom": 0,
177 
178     // Set to false to disable scrolling past the end of the buffer.
179     // On OS X, this value is overridden in the platform specific settings, so
180     // you‘ll need to place this line in your user settings to override it.
181     // 设置为false时,滚动到文本的最下方时,没有缓冲区
182     "scroll_past_end": true,
183 
184     // This controls what happens when pressing up or down when on the first
185     // or last line.
186     // On OS X, this value is overridden in the platform specific settings, so
187     // you‘ll need to place this line in your user settings to override it.
188     // 控制向上或向下到第一行或最后一行时发生什么(没明白也没试出来)
189     "move_to_limit_on_up_down": false,
190 
191     // Set to "none" to turn off drawing white space, "selection" to draw only the
192     // white space within the selection, and "all" to draw all white space
193     // 按space或tab时,实际会产生白色的点(一个空格一个点)或白色的横线(tab_size设置的制表符的宽度),选中状态下才能看到
194     // 设置为none时,什么情况下都不显示这些点和线
195     // 设置为selection时,只显示选中状态下的点和线
196     // 设置为all时,则一直显示
197     "draw_white_space": "selection",
198 
199     // Set to false to turn off the indentation guides.
200     // The color and width of the indent guides may be customized by editing
201     // the corresponding .tmTheme file, and specifying the colors "guide",
202     // "activeGuide" and "stackGuide"
203     // 制表位的对齐白线是否显示,颜色可在主题文件里设置(guide,activeGuide,stackGuide)
204     "draw_indent_guides": true,
205 
206     // Controls how the indent guides are drawn, valid options are
207     // "draw_normal" and "draw_active". draw_active will draw the indent
208     // guides containing the caret in a different color.
209     // 制表位的对齐白线,draw_normal为一直显示,draw_active为只显示当前光标所在的代码控制域
210     "indent_guide_options": ["draw_normal"],
211 
212     // Set to true to removing trailing white space on save
213     // 为true时,保存文件时会删除每行结束后多余的空格
214     "trim_trailing_white_space_on_save": false,
215 
216     // Set to true to ensure the last line of the file ends in a newline
217     // character when saving
218     // 为true时,保存文件时光标会在文件的最后向下换一行
219     "ensure_newline_at_eof_on_save": false,
220 
221     // Set to true to automatically save files when switching to a different file
222     // or application
223     // 切换到其它文件标签或点击其它非本软件区域,文件自动保存
224     "save_on_focus_lost": false,
225 
226     // The encoding to use when the encoding can‘t be determined automatically.
227     // ASCII, UTF-8 and UTF-16 encodings will be automatically detected.
228     // 编码时不能自动检测编码时,将自动检测ASCII, UTF-8 和 UTF-16
229     "fallback_encoding": "Western (Windows 1252)",
230 
231     // Encoding used when saving new files, and files opened with an undefined
232     // encoding (e.g., plain ascii files). If a file is opened with a specific
233     // encoding (either detected or given explicitly), this setting will be
234     // ignored, and the file will be saved with the encoding it was opened
235     // with.
236     // 默认编码格式
237     "default_encoding": "UTF-8",
238 
239     // Files containing null bytes are opened as hexadecimal by default
240     // 包含空字节的文件被打开默认为十六进制
241     "enable_hexadecimal_encoding": true,
242 
243     // Determines what character(s) are used to terminate each line in new files.
244     // Valid values are ‘system‘ (whatever the OS uses), ‘windows‘ (CRLF) and
245     // ‘unix‘ (LF only).
246     // 每一行结束的时候用什么字符做终止符
247     "default_line_ending": "system",
248 
249     // When enabled, pressing tab will insert the best matching completion.
250     // When disabled, tab will only trigger snippets or insert a tab.
251     // Shift+tab can be used to insert an explicit tab when tab_completion is
252     // enabled.
253     // 设置为enabled时,在一个字符串间按Tab将插入一个制表符
254     // 设置为true时,按Tab会根据前后环境进行代码自动匹配填补
255     "tab_completion": true,
256 
257     // Enable auto complete to be triggered automatically when typing.
258     // 代码提示
259     "auto_complete": true,
260 
261     // The maximum file size where auto complete will be automatically triggered.
262     // 代码提示的大小限制
263     "auto_complete_size_limit": 4194304,
264 
265     // The delay, in ms, before the auto complete window is shown after typing
266     // 代码提示延迟显示
267     "auto_complete_delay": 50,
268 
269     // Controls what scopes auto complete will be triggered in
270     // 代码提示的控制范围
271     "auto_complete_selector": "source - comment",
272 
273     // Additional situations to trigger auto complete
274     // 触发代码提示的其他情况
275     "auto_complete_triggers": [ {"selector": "text.html", "characters": "<"} ],
276 
277     // By default, auto complete will commit the current completion on enter.
278     // This setting can be used to make it complete on tab instead.
279     // Completing on tab is generally a superior option, as it removes
280     // ambiguity between committing the completion and inserting a newline.
281     // 设为false时,选择提示的代码按回车或点击可以输出出来,但选择true时不会输出而是直接换行
282     "auto_complete_commit_on_tab": false,
283 
284     // Controls if auto complete is shown when snippet fields are active.
285     // Only relevant if auto_complete_commit_on_tab is true.
286     // auto_complete_commit_on_tab必须为true,控制代码提示的活跃度
287     "auto_complete_with_fields": false,
288 
289     // By default, shift+tab will only unindent if the selection spans
290     // multiple lines. When pressing shift+tab at other times, it‘ll insert a
291     // tab character - this allows tabs to be inserted when tab_completion is
292     // enabled. Set this to true to make shift+tab always unindent, instead of
293     // inserting tabs.
294     // 设置为false,使用Shift + tab总是插入制表符
295     "shift_tab_unindent": false,
296 
297     // If true, the copy and cut commands will operate on the current line
298     // when the selection is empty, rather than doing nothing.
299     //复制与剪切的
300     "copy_with_empty_selection": true,
301 
302     // If true, the selected text will be copied into the find panel when it‘s
303     // shown.
304     // On OS X, this value is overridden in the platform specific settings, so
305     // you‘ll need to place this line in your user settings to override it.
306     // 选中的文本按Ctrl + f时,自动复制到查找面板的文本框里
307     "find_selected_text": true,
308 
309     // When drag_text is enabled, clicking on selected text will begin a
310     // drag-drop operation
311     //拖动文本
312     "drag_text": true,
313 
314     //
315     // User Interface Settings
316     //
317 
318     // The theme controls the look of Sublime Text‘s UI (buttons, tabs, scroll bars, etc)
319     //主题
320     "theme": "Default.sublime-theme",
321 
322     // Set to 0 to disable smooth scrolling. Set to a value between 0 and 1 to
323     // scroll slower, or set to larger than 1 to scroll faster
324     // 滚动的速度
325     "scroll_speed": 1.0,
326 
327     // Controls side bar animation when expanding or collapsing folders
328     // 左边边栏文件夹动画
329     "tree_animation_enabled": true,
330 
331     // Makes tabs with modified files more visible
332     //高亮未保存文件
333     "highlight_modified_tabs": false,
334     // 标签页的关闭按钮
335     "show_tab_close_buttons": true,
336 
337     // Show folders in the side bar in bold
338     //在侧边栏显示文件夹
339     "bold_folder_labels": false,
340 
341     // OS X 10.7 only: Set to true to disable Lion style full screen support.
342     // Sublime Text must be restarted for this to take effect.
343     //开启全屏,针对 OS X 10.7
344     "use_simple_full_screen": false,
345 
346     // OS X only. Valid values are true, false, and "auto". Auto will enable
347     // the setting when running on a screen 2880 pixels or wider (i.e., a
348     // Retina display). When this setting is enabled, OpenGL is used to
349     // accelerate drawing. Sublime Text must be restarted for changes to take
350     // effect.
351     //针对OS X,使用OpenGL画图,需重启
352     "gpu_window_buffer": "auto",
353 
354     // Valid values are "system", "enabled" and "disabled"
355     //延迟滚动条
356     "overlay_scroll_bars": "system",
357 
358     //
359     // Application Behavior Settings
360     //
361 
362     // Exiting the application with hot_exit enabled will cause it to close
363     // immediately without prompting. Unsaved modifications and open files will
364     // be preserved and restored when next starting.
365     //
366     // Closing a window with an associated project will also close the window
367     // without prompting, preserving unsaved changes in the workspace file
368     // alongside the project.
369     // 热退出功能!退出时不会提示是否保存文件,而是直接退出
370     "hot_exit": true,
371 
372     // remember_open_files makes the application start up with the last set of
373     // open files. Changing this to false will have no effect if hot_exit is
374     // true
375     //记忆之前打开的文件
376     "remember_open_files": true,
377 
378     // OS X only: When files are opened from finder, or by dragging onto the
379     // dock icon, this controls if a new window is created or not.
380     //始终在新窗口打开文件,针对OS X
381     "open_files_in_new_window": true,
382 
383     // OS X only: This controls if an empty window is created at startup or not.
384     //在打开程序的时候新建窗口,针对OS X
385     "create_window_at_startup": true,
386 
387     // Set to true to close windows as soon as the last file is closed, unless
388     // there‘s a folder open within the window. This is always enabled on OS X,
389     // changing it here won‘t modify the behavior.
390     //当没有文件时,关闭程序,针对Windows
391     "close_windows_when_empty": false,
392 
393     // Show the full path to files in the title bar.
394     // On OS X, this value is overridden in the platform specific settings, so
395     // you‘ll need to place this line in your user settings to override it.
396     //在标题栏显示绝对路径
397     "show_full_path": true,
398 
399     // Shows the Build Results panel when building. If set to false, the Build
400     // Results can be shown via the Tools/Build Results menu.
401     "show_panel_on_build": true,
402 
403     // Preview file contents when clicking on a file in the side bar. Double
404     // clicking or editing the preview will open the file and assign it a tab.
405     //在侧边栏预览文件
406     "preview_on_click": true,
407 
408     // folder_exclude_patterns and file_exclude_patterns control which files
409     // are listed in folders on the side bar. These can also be set on a per-
410     // project basis.
411     // 哪些文件会被显示到边栏上
412     "folder_exclude_patterns": [".svn", ".git", ".hg", "CVS"],
413     "file_exclude_patterns": ["*.pyc", "*.pyo", "*.exe", "*.dll", "*.obj","*.o", "*.a", "*.lib", "*.so", "*.dylib", "*.ncb", "*.sdf", "*.suo", "*.pdb", "*.idb", ".DS_Store", "*.class", "*.psd", "*.db"],
414     // These files will still show up in the side bar, but won‘t be included in
415     // Goto Anything or Find in Files
416     "binary_file_patterns": ["*.jpg", "*.jpeg", "*.png", "*.gif", "*.ttf", "*.tga", "*.dds", "*.ico", "*.eot", "*.pdf", "*.swf", "*.jar", "*.zip"],
417 
418     // List any packages to ignore here. When removing entries from this list,
419     // a restart may be required if the package contains plugins.
420     // 删除你想要忽略的插件,需要重启
421     "ignored_packages": ["Vintage"]
422 }

 

以上是关于sublime text 配置文件的主要内容,如果未能解决你的问题,请参考以下文章

Sublime Text3自定义代码片段

如何在Sublime Text中添加代码片段

sublime text 3 添加代码片段

sublime text3 增加代码片段(snipper)

sublime text 3 添加 javascript 代码片段 ( snippet )

Sublime Text自定制代码片段(Code Snippets)