sublime text 配置

Sublime 编辑器

一个跨平台,速度极快的编辑器,在我心中是最好的编辑器了

官网地址:http://www.sublimetext.com/

提前备好梯子,因为下载和安装插件都需要

配置

快捷键

F11 开启全屏

Alt+. 闭合标签

Alt+Shift+数字 分屏显示

安装插件及汉化

  1. 使用快捷键 Ctrl+Shift+P
  2. 输入 package control
  3. 汉化--输入Chinese,安装语言包即可
  4. 主题推荐:material theme,seti
  5. 字体大小:16px
  6. 配色方案:monokaionedark
  7. 图标方案:A File Icon

插件

SideBarEnhancements

配置 package setting>slide bar>key bingings>user

[
    { "keys": ["ctrl+shift+c"], "command": "copy_path" },
    //chrome
    { "keys": ["f1"], "command": "side_bar_files_open_with",
        "args": {
            "paths": [],
            "application": "C:\\Users\\Yecss\\AppData\\Local\\Google\\Chrome\\Application\\chrome.exe",
            "extensions":".*"
        }
    },
]

liveload

实时查看HTML页面的变化。

javascript-API-Completions

JavaScript代码补全

user - package setting 配置文件

{  
  // --------------------  
  // sublime-better-completions-Package (sbc package)  
  // --------------------  
  // API files is contains the *keyword* such as `html`, `jquery`, `myglossary` with lowercase as filename `sbc-api-${filename}.sublime-settings` place in `/packages/User/` (your own) or `/packages/${this-package}/sublime-completions/` (package build-in).  
  // After you enable, disable or added new your own completions, you might need restart your Sublime Text Editor.  
  //  
  // Your own setting file `sbc-setting.sublime-settings` need to place in `/packages/User/` and contains all your api setting property that you want to enable.  
  //  
  // --------------------  
  // APIs Setup  
  // --------------------  
  // `true` means enable it.  
  // `false` means disable it.  
  "completion_active_list": {  
    // build-in completions  
    "css-properties": true,  
    "gruntjs-plugins": true,  
    "html": false,  
    "lodash": true,  
    "javascript": true,  
    "jquery": true,  
    "jquery-sq": true, // Single Quote  
    "php": true,  
    "phpci": true,  
    "sql": true,  
    "twitter-bootstrap": true,  
    "twitter-bootstrap-less-variables": true,  
    "twitter-bootstrap3": true,  
    "underscorejs": true,  
    "react": true,  
  
    // Your own completions?  
    // ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/sbc-api-my-angularjs.sublime-settings  
    "my-angularjs": true,  
  
    // ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/sbc-api-my-glossary.sublime-settings  
    "my-glossary": true,  
  
    // ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/sbc-api-my-html.sublime-settings  
    "my-html": true,  
  
    // ~/Library/Application\ Support/Sublime\ Text\ 3/Packages/User/sbc-api-my-javascript.sublime-settings  
    "my-javascript": false  
  }  
}

使用技巧

  1. Alt键临时显示菜单栏
  2. Shift+F11进入专注模式

代码快速补全

html:
div#box > <div id="box"></div>

JavaScript:
dt > document
qs > querySelector
gd > getElementById

C语言编译

{
    // "shell_cmd": "make"
    "encoding": "utf-8",
    "working_dir": "$file_path",
    "shell_cmd": "g++ -Wall -std=c++0x \"$file_name\" -o \"$file_base_name\"",
    "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
    "selector": "source.c",

    "variants": 
    [
        {   
        "name": "Run",
            "shell_cmd": "g++ -Wall -std=c++0x  \"$file\" -o \"$file_base_name\" && \"${file_path}/${file_base_name}\""
        },
        {   
        "name": "RunInCmd",
            "shell_cmd": "gcc -finput-charset=UTF-8 -fexec-charset=GBK \"${file}\" -o \"${file_base_name}\".exe  && start cmd /c \"\"${file_path}/${file_base_name}\" & pause \""
        }
    ]
}

Python编译

{
	"cmd": ["python","-u","$file"],
	"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
	"selector": "source.python",
	"variants":
		[
			{
				"name":"Run",
				"shell": true,
				"cmd": ["start","cmd","/c", "python $file &echo. & pause"],
				"working_dir": "${file_path}",
			}
		]
}
posted @ 2020-08-11 15:58  海浪博客  阅读(170)  评论(0编辑  收藏  举报