Sublime Text3安装配置

Posted

tags:

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

Sublime Text3的所有package都可在如下网站检索

https://packagecontrol.io/browse

以下是我的插件列表

 

CoolFormat

一款C\\C++\\C#\\CSS\\html\\Java\\javascript\\JSON\\Objective-C\\php\\SQL\\XML代码格式化工具。

主页:https://akof1314.github.io/CoolFormat/

快捷键:

Ctrl + Shift + Alt + Q : Quick Format

Ctrl + Shift + Alt + S : Selected Format

创建右键菜单

点击Preferences->Browse Packages…,打开CoolFormat插件文件夹 
进入CoolFormat文件夹,创建名为“Context.sublime-menu”的文件 
编辑如下内容,保存

[
  {
    "caption": "CoolFormat",
    "children": [
      {
        "caption": "CoolFormat: Quick Format",
        "command": "coolformat",
        "args": {
          "action": "quickFormat"
        }
      },
      {
        "caption": "CoolFormat: Selected Format",
        "command": "coolformat",
        "args": {
          "action": "selectedFormat"
        }
      },
      {
        "caption": "CoolFormat: Formatter Settings",
        "command": "coolformat",
        "args": {
          "action": "formatterSettings"
        }
      }
    ]
  }
]

BracketHighlighter

高亮Bracket

配置

打开Pregerence > Package Settings > BracketHighlighter > Bracket Settings - User

以下是我的配置

{
    "bracket_styles": {
        "default": {
            "icon": "dot",
            // "color": "entity.name.class",
            "color": "brackethighlighter.default",
            "style": "highlight"
        },
 
        "unmatched": {
            "icon": "question",
            "color": "brackethighlighter.unmatched",
            "style": "highlight"
        },
        "curly": {
            //{}
            "icon": "curly_bracket",
            "color": "brackethighlighter.curly",
            "style": "underline"
        },
        "round": {
            //()
            "icon": "round_bracket",
            "color": "brackethighlighter.round",
            "style": "underline"
        },
        "square": {
            //[]
            "icon": "square_bracket",
            
            "color": "brackethighlighter.square",
            "style": "underline"
        },
        "angle": {
            //<>
            "icon": "angle_bracket",
            "color": "brackethighlighter.angle",
            "style": "highlight"
        },
        "tag": {
            "icon": "tag",
            "color": "brackethighlighter.tag",
            "style": "highlight"
        },
        "single_quote": {
            //"
            "icon": "single_quote",
            "color": "brackethighlighter.quote",
            "style": "highlight"
        },
        "double_quote": {
            //""
            "icon": "double_quote",
            "color": "brackethighlighter.quote",
            "style": "underline"
        },
        "regex": {
            "icon": "regex",
            "color": "brackethighlighter.quote",
            "style": "outline"
        }
    }
 
}

另外根据配色方案进一步修改配置,我使用的是Monokai配色方案,因此找到Monokai.thTheme文件(不知道在哪个目录直接搜索,可使用everything或是Listary等软件),添加以下代码,也可自行更改配色,格式大致一样。

<dict>
				<key>name</key>
				<string>Bracket Unmatched</string>
				<key>scope</key>
				<string>brackethighlighter.unmatched</string>
				<key>settings</key>
				<dict>
					<key>foreground</key>
					<string>#FFFFFF</string>
					<key>background</key>
					<string>#FF0000</string>
				</dict>
			</dict>

			<dict>
				<key>name</key>
				<string>Bracket Curly</string>
				<key>scope</key>
				<string>brackethighlighter.curly</string>
				<key>settings</key>
				<dict>
					<key>foreground</key>
					<string>#FF00FF</string>
				</dict>
			</dict>

			<dict>
				<key>name</key>
				<string>Bracket Round</string>
				<key>scope</key>
				<string>brackethighlighter.round</string>
				<key>settings</key>
				<dict>
					<key>foreground</key>
					<string>#E7FF04</string>
				</dict>
			</dict>

			<dict>
				<key>name</key>
				<string>Bracket Square</string>
				<key>scope</key>
				<string>brackethighlighter.square</string>
				<key>settings</key>
				<dict>
					<key>foreground</key>
					<string>#FE4800</string>
				</dict>
			</dict>

			<dict>
				<key>name</key>
				<string>Bracket Angle</string>
				<key>scope</key>
				<string>brackethighlighter.angle</string>
				<key>settings</key>
				<dict>
					<key>foreground</key>
					<string>#02F78E</string>
				</dict>
			</dict>

			<dict>
				<key>name</key>
				<string>Bracket Quote</string>
				<key>scope</key>
				<string>brackethighlighter.quote</string>
				<key>settings</key>
				<dict>
					<key>foreground</key>
					<string>#56FF00</string>
				</dict>
			</dict>
			<dict>
				<key>name</key>
				<string>Bracket Tag</string>
				<key>scope</key>
				<string>brackethighlighter.tag</string>
				<key>settings</key>
				<dict>
					<key>foreground</key>
					<string>#FFFFFF</string>
					<key>background</key>
					<string>#6959CD</string>
				</dict>
			</dict>

SublimeLinter

代码校验工具。具体的Linters组件不包含在SublimeLinter 3中。对于要检查的语言必须安装相应的Linters组件

github:https://github.com/SublimeLinter/SublimeLinter3

注意:Linters组件依赖于nodeJS,因此要使组件可以使用必须安装nodeJS环境,(据说64位会出问题),之后就可进入 Package Control安装SublimeLinter-csslint等组件

技术分享

ConvertToUTF8

防乱码必备,可以编辑并保存目前编码不被 Sublime Text 支持的文件,特别是中日韩用户使用的 GB2312,GBK,BIG5,EUC-KR,EUC-JP 等。

github:https://github.com/seanliang/ConvertToUTF8

C Improved

更加人性化的C语言着色方案,比自带的配色好多了

github:https://github.com/abusalimov/SublimeCImproved

AutoFileName

当需要插入某个文件时,可自动跳出文件路径。

github:https://github.com/BoundInCode/AutoFileName

SublimeREPL

用于直接在Sublime中单步运行解释型语言,例如R、Python、Ruby、Scala等

github:https://github.com/wuub/SublimeREPL

Vintageous

在Vintage基础上的一些改进,更易于在Sublime上体验Vim模式。

github:https://github.com/guillermooo/Vintageous

  

 

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

sublime text3 增加代码片段(snipper)

sublime text3 添加新片段

Sublime text3最全快捷键清单

sublime text3 安装配置

Sublime Text3安装以及初次配置

Sublime Text3安装配置