[关闭]
@smallcatx0 2018-03-07T07:13:52.000000Z 字数 3850 阅读 1025

Sublime Text3 调教史(by:smallcat)

sublime


Sublime3 调教史

实时更新链接
更多sublime问题请访问我的博客
欢迎加入Sublime插件交流群:711413537
SublimeText3154自用版下载

0.常用快捷键

1.插件(已经安装过的)

  1. { "keys": ["ctrl+shift+c"], "command": "copy_path" },
  2. //
  3. { "keys": ["f1"], "command": "side_bar_files_open_with",
  4. "args": {
  5. "paths": [],
  6. // 浏览器地址
  7. "application": "C:\\software\\Browser\\Mozilla Firefox\\firefox.exe",
  8. "extensions":".*" //匹配任何文件类型
  9. }
  10. },

HTML: Ctrl+Alt+H
Javascript: Ctrl+Alt+J
CSS: Ctrl+Alt+C
PHP: Ctrl+Alt+P
Ruby: Ctrl+Alt+R
Python: Ctrl+Alt+Shift+P

2.编译系统(Build-System)

1.java Build-System

  1. {
  2. "shell_cmd": "ECHO Compiling $file_base_name.java & ECHO ============Out============ & javac -encoding UTF-8 \"$file\" & java \"$file_base_name\"",
  3. "file_regex": "^(...*?):([0-9]*):?([0-9]*)",
  4. "working_dir": "${file_path}",
  5. "selector": "source.java",
  6. "encoding":"gbk",
  7. "variants":[
  8. { // 仅编译
  9. "name":"仅编译",
  10. "shell_cmd": "ECHO Compiling $file_base_name.java & javac -d . -encoding UTF-8 \"$file\"",
  11. },
  12. { // 运当前文件名的类
  13. "name":"仅运行当前类",
  14. "shell_cmd":" java \"$file_base_name\" "
  15. },
  16. { // 在CMD中运行
  17. "name":"在cmd中运行",
  18. "shell_cmd":" start cmd /c \"javac -encoding UTF-8 \"$file\" & java \"$file_base_name\" & pause \""
  19. }
  20. ]
  21. }

2.C/C++ Build-System

  1. {
  2. //编译环境路径
  3. "path": "D:\\Program Files (x86)\\Sublime_Text3154\\MinGW32\\bin",
  4. // "cmd": ["g++","-Wall","-std=c++11", "${file}", "-o", "${file_path}/${file_base_name}"],// 常规编译命令
  5. "shell_cmd" : "g++ -Wall -std=c++11 \"$file\" -o \"$file_base_name\"",// 编译运行命令
  6. "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
  7. "working_dir": "${file_path}",
  8. "selector": "source.c, source.c++",
  9. "encoding":"gbk",
  10. "variants":[
  11. // 编译运行
  12. {
  13. "name": "Run",
  14. "shell_cmd" : "g++ -Wall -std=c++11 \"$file\" -o \"$file_base_name\" && ${file_path}/${file_base_name}"
  15. },
  16. {
  17. "name":"CMD Run",
  18. "shell":true,
  19. "shell_cmd":"g++ -Wall -std=c++11 \"$file\" -o \"$file_base_name\" && start cmd /c \"\"${file_path}/${file_base_name}\" & pause\""
  20. }
  21. ]
  22. }

3.Python build-system

  1. {
  2. // 指定python.exe的目录【针对未将python加入环境变量的】
  3. // "path": "",
  4. "shell_cmd": "python -u \"$file\"",
  5. "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
  6. "selector": "source.python",
  7. "env": {"PYTHONIOENCODING": "utf-8"},
  8. "variants":
  9. [
  10. {
  11. "name" :"Run cmd",
  12. "shell" :true,
  13. "shell_cmd":"start cmd /c \" python \"$file\" & pause\""
  14. }
  15. ]
  16. }
添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注