Sublime Text 3 的相關設定 - oracle-design/guides GitHub Wiki

安裝 Package Controller

可參考 https://packagecontrol.io/installation 的說明,Sublime Text 2 和 3 的內容有差異。

安裝完後按下 cmd + shift + p 使用 install package 指令就可以安裝套件。

推薦使用的 packages

  • Emmet
  • SideBarEnhancements
  • BracketHighlighter
  • Alignment
  • Git
  • GitGutter
  • All Autocomplete
  • SCSS
  • AdvancedNewFile
  • BracketGuard
  • Origami
  • Rails Partial
  • SublimeRailsNav

推薦使用字體

Input

這也是一套為 Code 設計的字體,除了閱讀清楚之外,更可以依照自己的需求自訂字體表現的方式gr,可以到 這個頁面 來客製化自己習慣的字體,讓 code 的閱讀變得更舒服。

推薦設定

{
  "always_show_minimap_viewport": true,
  "auto_complete": true,
  "auto_complete_commit_on_tab": true,
  "bold_folder_labels": true,
  "caret_extra_width": 2,
  "caret_style": "phase",
  "close_windows_when_empty": false,
  "copy_with_empty_selection": false,
  "drag_text": true,
  "draw_white_space": "all",
  "ensure_newline_at_eof_on_save": true,
  "fade_fold_buttons": false,
  "font_face": "InputMonoCondensed-Light",
  "font_options":
  [
    "no_round"
  ],
  "font_size": 15.0,
  "gpu_window_buffer": true,
  "highlight_line": true,
  "indent_guide_options":
  [
    "draw_active"
  ],
  "index_files": true,
  "line_padding_bottom": 2,
  "line_padding_top": 2,
  "open_files_in_new_window": false,
  "origami_auto_zoom_on_focus": 0.6,
  "rulers":
  [
    79
  ],
  "scroll_past_end": true,
  "show_encoding": true,
  "show_full_path": false,
  "show_line_endings": true,
  "tab_size": 2,
  "translate_tabs_to_spaces": true,
  "trim_trailing_white_space_on_save": true,
  "word_wrap": false
}

以上可依喜好來調整設定,但:

  • "tab_size": 2
    TAB 為兩個空白寬度
  • "translate_tabs_to_spaces": true
    將 TAB 轉換為空白
  • "trim_trailing_white_space_on_save": true
    存檔時自動清除行末的空白字元
  • "ensure_newline_a_eof_on_save": true 存檔時確保文件最後有一個空行

這幾項與 code style 有關必須統一設定。