mac sublime text3 环境设置

  1. 下载后安装

  2. 安装package control

  3. package control->pip->soda 安装soda主题

  1. python2环境 tools->build system-> new build system

    1
    2
    3
    {
    "cmd": ["/usr/bin/python", "-u", "$file"],
    }

    ​ “/usr/bin/python” 为机器上的python2命令所在目录

    ​ 保存为python2.sublime-build

  2. python3环境:与python2类似

  3. golang环境

    ​ package control->安装Golang build
    ​ perferences -> package settings -> Golang Config -> Settings-User
    ​ 配置PATH和GOPATH

    1
    2
    3
    4
    {
    "PATH": "/usr/local/go/bin", //go安装路径
    "GOPATH": "/Users/lijinqi/go" // go env中的地址
    }

    ​ 跳转到package目录下,git clone https://margo.sh/GoSublime
    ​ perferences -> package settings -> GoSublime-> Settings-User

    1
    2
    3
    4
    5
    6
    {
    "env": {
    "GOPATH": "/Users/lijinqi/go", // go env中的地址
    "GOROOT": "/usr/local/go" //go安装路径
    }
    }

    ​ tools->build system->选择Go
    ​ 编写一个go程序,通过command + shift + b或者 command + b即可以在控制台运行该程序。

  4. 配置

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    {
    "find_selected_text": true, //!!! 搜索时自动填入所选内容
      "theme": "Soda Light 3.sublime-theme",
      "color_scheme": "Packages/Color Scheme - Default/Mac Classic.tmTheme",
      "font_size": 11,
      "ignored_packages":
      [
      "Vintage"
      ],
      "show_encoding": true,
      "soda_classic_tabs": true,
      "soda_folder_icons": true,
      "highlight_line": true,    // 高亮显示当前行
      "fade_fold_buttons": false, // 代码折叠按钮一直显示
      "show_encoding": true,    // 显示当前文件的编码
      "bold_folder_labels": true, // 加粗文件夹名称
      "highlight_modified_tabs": true,      // 着重标示修改过的文件
    "update_check": false,//更新检查,
    "save_on_focus_lost": true, //当你把焦点从当前编辑的文件移开的时候,这个文件会自动的保存掉。
    "show_full_path": true, //显示全路径
    "translate_tabs_to_spaces": true, //tab转为空格
    "tab_size": 4, //tab代表4个空格
      //"trim_trailing_white_space_on_save": true, // 保存时去掉行尾无用空格
      "show_full_path": true,           // 显示全路径,默认
      // "show_line_endings": true,
      // "draw_white_space": "all",        // 显示所有空格,"none"|"selection"|"all"
      // "sublime_enhanced_keybindings": true, // 转到上一次编辑的地方
      // "word_wrap": true,            // 文字根据屏幕大小自动换行,防止水平滚动 true | false | "auto"
      // "save_on_focus_lost": true,        // 焦点丢失后自动保存
    }
  1. 插件
    soda主题
    BracketHighlighter 括号高亮

    prettyJson json格式化插件

    ConvertToUTF8:将除UTF8编码之外的其他编码文件在 Sublime Text 中转换成UTF8编码