教你如何將 Sublime 3 打造成 Python/Django IDE開發利器

來源:互聯網
上載者:User
1. 安裝 Sublime Text 3

雖然現在的 Sublime 3 還處於 beta 階段, 但已經非常穩定了, 而且速度比 Sublime 2 得到了增強. Sublime 3 可以到官網下載並安裝. Sublime 雖然是免費軟體, 但如果有足夠的經濟能力, 可以考慮購買以表示支援.

2. 安裝 Package Control

Sublime Package Control 可以說是必須安裝的外掛程式, 因為其方便的提供了安裝/升級/刪除 Sublime 外掛程式的功能, 安裝方法見Package Control 官網.

安裝完畢後, 就可以使用快速鍵 ctrl+shift+p (Win, Linux) 或 cmd+shift+p (OS X), 其中以 Package Control: 開頭的都是其相關命令, 最常用的可能就是 Package Control: Install Package, Package Control: Remove Package, Package Control: List Packages 這幾個命令了.

3. 推薦安裝的外掛程式

現在可以使用 Package Control 安裝其他外掛程式了. 使用快速鍵 ctrl+shift+p (Win, Linux) 或 cmd+shift+p (OS X), 輸入 Package Control: Install Package 斷行符號, 輸入 package 名再斷行符號安裝:

Anaconda

Anaconda是目前 Sublime 3 中最好的 Python 自動補全和文法提示外掛程式, 並且提供了"跳轉到定義", "尋找使用", "顯示文檔", "自動重新命名"等 IDE 中外掛程式的功能.

Djaneiro

提供了對Django的支援.

SideBarEnhancements

提供了對預設的側邊欄的增強功能. Sublime的側邊欄可以使用快速鍵 Ctrl+k Ctrl+b (Linux, Win), CMD+k CMD+b (OS X) 調出來. 安裝之後, 還可以通過F12鍵在瀏覽器中開啟當前檔案.

Git 相關

我們需要安裝 SublimeGit 和 GitGutter, 前者可以協助我們在 Sublime 中使用 Git 命令 (通過 ctrl+shift+p 或 cmd+shift+p), 後者在編輯時在 Gutter 顯示 Git 差異, 十分方便.

主題相關

Theme - Soda 和 Monokai Extended, 安裝之後在 user settings 中設定使用:

  "color_scheme": "Packages/Monokai Extended/Monokai Extended.tmTheme",  "theme": "Soda Dark 3.sublime-theme",

其他外掛程式

還可以安裝 Emmet, SublimeLinter (注意依賴關係), ColorPicker, Gitignore等外掛程式

4. 設定

以下是推薦的設定, 可以直接複製黏貼放入 user settings 中, 需要注意的是字型檔需要提前安裝:

  {  "always_show_minimap_viewport": true,  "auto_complete_commit_on_tab": false,  "auto_find_in_selection": true,  "bold_folder_labels": true,  "color_scheme": "Packages/Monokai Extended/Monokai Extended.tmTheme",  "theme": "Soda Dark 3.sublime-theme",  "default_line_ending": "unix",  "detect_indentation": false,  "detect_slow_plugins": false,  "drag_text": false,  "draw_white_space": "selection",  "ensure_newline_at_eof_on_save": true,  "fallback_encoding": "UTF-8",  "font_face": "Ubuntu Mono",  "font_size": 16,  "highlight_line": true,  "highlight_modified_tabs": true,  "ignored_packages":  [    "Vintageous",    "Vintage"  ],  "indent_guide_options":  [    "draw_active",    "draw_normal"  ],  "indent_to_bracket": true,  "line_padding_bottom": 1,  "line_padding_top": 1,  "preview_on_click": false,  "rulers":  [    120  ],  "scroll_past_end": true,  "shift_tab_unindent": true,  "show_encoding": true,  "tab_size": 4,  "translate_tabs_to_spaces": true,  "trim_automatic_white_space": true,  "trim_trailing_white_space_on_save": true,  "word_wrap": true,  "wrap_width": 120}
  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.