Sublime Text 2.0技巧汇总

1、如何去掉行尾空格?

点击菜单栏上的“Preferences->Setting-Default”,搜索“trim_trailing_white_space_on_save” 然后将false改为true,将在保存的时候去除行尾的空格。

2、如果解决在ST中中文字体难看的问题?

点击菜单栏上的“Preferences->Setting-User”,加入:"font_options": ["subpixel_antialias"]

3、如何更改字体大小?

CTRL+滚轮即可改变字体大小。

4、sublime text2如何运行python脚本?

ctrl+B组合键

5、使用说明及插件介绍

1、http://www.cnblogs.com/xiaowu/archive/2012/08/27/2658534.html

2、http://www.iplaysoft.com/sublimetext.html

3、http://blog.csdn.net/bhp1127/article/details/7714671

4、Sublime Text 2 设置文件详解

6、SideBarEnhancements

推荐通过 Package Control 安装 SideBarEnhancements 这个插件,可以大大加强在侧栏目录树中右键的选项

7、我安装的插件

a、ctags

  这个插件能跨文件跳转,跳转到指定函数声明的地方(ctrl+alt+左键)。 使用package control 搜索ctags 进行安装(安装ctags插件就可以了, 还有一个 CTags for PHP 插件没什么用),注意安装好插件后要需要安装ctags命令。window 下载 ctags.exe  http://vdisk.weibo.com/s/7QZd7 。 将ctags.exe文件放在一个环境变量能访问到的地方。打开cmd, 输入ctags,如果有这个命令,证明成功了。ubuntu下安装运行命令:sudo apt-get install exuberant-ctags 。然后在sublime项目文件夹右键, 会出现Ctag:Rebuild Tags 的菜单。点击它,然后会生成.tags的文件 然后在你代码中, 光标放在某个函数上, 点击 就可以跳转到函数声明的地方。

b、Bracket Highlighter

类似于代码匹配,可以匹配括号,引号等符号内的范围


c、Sublime Alignment

用于代码格式的自动对齐


sublime text2的 Alignment 插件用什么快捷键使用

快捷键为 Ctrl+Alt+A,但如果你用QQ的话,就与QQ的截图功能冲突了。那么改一下快捷键:

打开 Preferences=>Package Settings=>Alignment=>Key Bindding - User

  1. [  
  2.     { "keys": ["ctrl+alt+f"], "command": "alignment" }  
  3. ]  

或者改成其他不冲突的快捷键即可

Alignment插件通过package install找不到怎么办?

手动安装,在此下载Alignment 插件,然后解压到 /Data/Packages目录即可。重新打开 sublime text。或者通过package install 输入 alignment,选择 alignment,不要选择code alignment 即可自动下载。

8、Sublime Text 2 文档

http://saelabs.sinaapp.com/Sublime/index.html

9、我的配置

使用theme为:Theme - Nexus 通过package-install,输入theme,找到 Theme - Nexus

Preferences.sublime-settings的内容更改为:

  1. {  
  2.     "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",  
  3.     "font_options":  
  4.     [  
  5.         "subpixel_antialias"  
  6.     ],  
  7.     "font_size": 14.0,  
  8.     "theme": "Nexus.sublime-theme",  
  9.   
  10.     "highlight_line": true,  
  11.     "word_wrap": true,  
  12.     "trim_trailing_white_space_on_save": true,  
  13.     "line_numbers": true,  
  14.     "line_padding_top": 2,  
  15.     "line_padding_bottom": 0,  
  16.     "auto_indent": true,  
  17.     "auto_match_enabled": false,  
  18.     "draw_minimap_border": true,  
  19.     "draw_white_space": "selection",  
  20.     "match_brackets": true,  
  21.   
  22.     "translate_tabs_to_spaces": false,  
  23.     "tab_size":4,  
  24.     "detect_indentation":true,  
  25.     "use_tab_stops":true  
  26.   
  27. }  


10、如何让sublime2左边的side不显示某些类型文件

在项目中,有时候样式文件是放在图片目录image下的。这时候如果编辑样式文件,通过sublime2左侧的side来查找很是麻烦,因为他会显示所有类型的文件。在一大堆图片文件中找到样式文件,非常麻烦。不急,下面的方法可以彻底解决这个烦恼。如下图所示:

选择“菜单栏”->“Settings - User”,在出现的文件中添加以下内容:

  1. "file_exclude_patterns": ["*.jpg", "*.gif","*.png"]  

这表示,在右侧的side中,不显示jpg格式,gif格式和png格式的文件。你可以按此规律添加你想要过滤的文件。保存后,立即看到效果。

我的Sublime Text 2.0\Data\Packages\User\Preferences.sublime-settings的文件内容如下:

  1. {  
  2.     "file_exclude_patterns": ["*.jpg", "*.gif","*.png"],  
  3.     "auto_indent": true,  
  4.     "auto_match_enabled": true,  
  5.     "color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",  
  6.     "detect_indentation": true,  
  7.     "draw_minimap_border": true,  
  8.     "draw_white_space": "selection",  
  9.     "font_options":  
  10.     [  
  11.         "subpixel_antialias"  
  12.     ],  
  13.     "font_size": 14.0,  
  14.     "highlight_line": true,  
  15.     "ignored_packages":  
  16.     [  
  17.         "Vintage"  
  18.     ],  
  19.     "line_numbers": true,  
  20.     "line_padding_bottom": 0,  
  21.     "line_padding_top": 2,  
  22.     "match_brackets": true,  
  23.     "tab_size": 4,  
  24.     "theme": "Nexus.sublime-theme",  
  25.     "translate_tabs_to_spaces": false,  
  26.     "trim_trailing_white_space_on_save": true,  
  27.     "use_tab_stops": true,  
  28.     "word_wrap": false  
  29. }  
原文地址:https://www.cnblogs.com/webu/p/3117005.html