##Package Controlのインストール
メニューのView -> Show Consoleで以下のコマンドを貼り付けてEnter。
import urllib2,os; pf='Package Control.sublime-package';ipp=sublime.installed_packages_path(); os.makedirs(ipp) if not os.path.exists(ipp) else None; urllib2.install_opener(urllib2.build_opener(urllib2.ProxyHandler())); open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read()); print 'Please restart Sublime Text to finish installation'
インストール完了後、再起動すればPackage Controlのインストール完了.
参照
おすすめエディタSublime Text2の導入と設定(初期設定編)
##パッケージのインストール
- 上記Package Controlのインストール完了後、Shift + Command + pでCommand Palletが開くので、installと入力。
- Packageの検索ができるので、必要なパッケージの名前を入力してインストール。
※以下のパッケージをインストール。
※必要に応じて追加/削除してください。
CoffeeScript
CSS Snippets
Emmet
Html5
JavaScript Snippets
jQuery Snippets Pack
LESS
Markdown Preview
Sass
SideBarEnhancements
TypeScript
##パッケージの削除
- Ctrl+Shif+p
- 「Remove Package」を入力
- リストアップされている項目を選択してEnter
- インストールされているパッケージが一覧表示されるので、削除したいパッケージを選択してEnterで削除される。
##Key Bindings
メニューのSublime Text2 -> Preferenes -> Key Bindings - Userで開かれるファイルに以下を記述。
※Commad + d -> カレント行の複製。
※Command + Tab -> 右側のタブをアクティブにする。
※Shift + Command + Tab -> 左側のタブをアクティブにする。
Default(OSX).sublime-keymap
[
// カレント行の複製
{ "keys": ["super+d"], "command": "duplicate_line" },
// タブの切替を表示順にする
{ "keys": ["ctrl+tab"], "command": "next_view" },
{ "keys": ["ctrl+shift+tab"], "command": "prev_view" },
{ "keys": ["alt+m"], "command": "markdown_preview", "args": {"target": "browser"} },
// Vim風タブの切替
{
"keys": ["g", "t"], "command": "next_view",
"context":
[
{ "key": "setting.is_widget", "operand": false },
{ "key": "setting.command_mode" }
]
},
{
"keys": ["g", "T"], "command": "prev_view",
"context":
[
{ "key": "setting.is_widget", "operand": false },
{ "key": "setting.command_mode" }
]
}
]
##ユーザ設定
メニューのSublime Text2 -> Preferenes -> Settings - Userで開かれるファイルに以下を記述。
Preferences.sublime-settings
{
"bold_folder_labels": true,
"close_windows_when_empty": false,
"color_scheme": "Packages/Color Scheme - Default/Cobalt.tmTheme",
"disable_formatted_linebreak": true,
"disable_tab_abbreviations": true,
"disabled_single_snippet_for_scopes": "",
"draw_minimap_border": true,
"draw_white_space": "all",
"enable_emmet_keymap": true,
"font_size": 10.0,
"highlight_line": true,
"highlight_modified_tabs": true,
"ignored_packages":
[
"",
"DocBlockr"
],
"indent_guide_options":
[
"draw_active"
],
"shift_tab_unindent": true,
"trim_trailing_white_space_on_save": true
}