Skip to content

Instantly share code, notes, and snippets.

@totobook
Last active December 15, 2015 21:28
Show Gist options
  • Save totobook/5325404 to your computer and use it in GitHub Desktop.
Save totobook/5325404 to your computer and use it in GitHub Desktop.

SublimeText 設定手順

ダウンロード

公式サイト

パッケージマネージャインストール

View → Show Console

import urllib2,os;pf='Package Control.sublime-package';ipp=sublime.installed_packages_path();os.makedirs(ipp) if not os.path.exists(ipp) else None;open(os.path.join(ipp,pf),'wb').write(urllib2.urlopen('http://sublime.wbond.net/'+pf.replace(' ','%20')).read())

再起動

キー設定

Preferences→Key Binding User

[
	{ "keys": ["ctrl+j"], "command": "insert", "args": {"characters": "\n"} },
	{ "keys": ["ctrl+m"], "command": "insert", "args": {"characters": "\n"} },
	{ "keys": ["ctrl+i"], "command": "insert_best_completion", "args": {"default": "\t", "exact": true} },
	{ "keys": ["f1"], "command": "markdown_preview", "args": {"target": "browser"} }
]

各種パッケージインストール

Ctrl + Shift + P からInstallと入力するとパッケージインストールを起動できる

Emacsキーバインド(一部)

Sublemacspro

IMEサポート(Windows利用時)

IMESupport

HTML、HTML5補完

HTML5

CSS補完

CSS snipet

jQuery補完

jQuery

Theme-Soda(カラー)

Theme-Soda

Additional PHP Snippets(PHP補完)

Additional PHP Snippets

SublimeCodeIntel(賢い補完)

SublimeCodeIntel

Markdown Preview

Markdown Preview

OmniMarkupPreviewer(より高機能なビューワ)

OmniMarkupPreviewer

PreferncesからUser設定で

{
	"mathjax_enabled": true
}

とすると、MathJaxが有効になりTex記法で数式が書ける。

Ctrl+Alt+oでデフォルトブラウザでリアルタイムプレビューが、Ctrl+Alt+xでHTMLに変換したファイルにエクスポートできる。

今んとこMarkdownのビューワとしては最高のもの。

BracketHighlighter(対応するタグやカッコを強調表示)

BracketHighlighter

SublimeREPL(irbを使うためのもの)

SublimeREPL

PlainTasks(TODOリスト)

PlainTasks
[
  { "keys": ["ctrl+shift+d"], "command": "plain_tasks_complete","context": [{ "key": "selector", "operator": "equal", "operand": "text.todo" }] },
  { "keys": ["ctrl+shift+m"], "command": "plain_tasks_cancel", "context": [{"key": "selector", "operator": "equal", "operand": "text.todo" }] },
  { "keys": ["ctrl+enter"], "command": "plain_tasks_new","context": [{ "key": "selector", "operator": "equal", "operand": "text.todo" }] },
  { "keys": ["ctrl+shift+a"], "command": "plain_tasks_archive","context": [{ "key": "selector", "operator": "equal", "operand": "text.todo" }] },
  { "keys": ["ctrl+shift+u"], "command": "plain_tasks_open_url","context": [{ "key": "selector", "operator": "equal", "operand": "text.todo" }] }
]

Sublime Terminal(コマンドプロンプトの起動)

Terminal

Preferences > Package Settings > Terminal > Settings – Default で、

"terminal": "cmd",

と書くと通常のコマンドプロンプトが、空文字だとパワーシェルが起動する(Windows7の場合)

ちなみにckw+nyaosの環境を作ったなら、その絶対パスを指定すればそれを起動することも可能。カレントディレクトリの指定をckw.cfgでコメントアウトすれば、呼び出したファイルのディレクトリに勝手に移動して起動してくれるのでおすすめ。

ひと通りインストールしたら再起動

設定変更

Preferences→Setting User

{
	"color_scheme": "Packages/Phix Color Scheme/Phix Dark.tmTheme",
	"theme": "Soda Dark.sublime-theme",
	"soda_classic_tabs": true,
	"default_encoding": "UTF-8",
	"draw_white_space": "all",
	"font_face": "TAKAOゴシック",
	"font_size": 15.0,
	"tab_size": 2,
	"highlight_line": true,
	"highlight_modified_tabs": true,
	"translate_tabs_to_spaces": false,
	"trim_automatic_white_space": false
	"show_full_path": false,
	"ignored_packages":
	[
	"Vintage"
	],
}

再起動する

Smarty対応

C:\ユーザー名\miyota\AppData\Roaming\Sublime Text 2\Packages\HTML HTML.tmLanguage
コメントアウトを外す

<!--
	<dict>
		<key>include</key>
		<string>#smarty</string>
	</dict>
-->

textmateのSmarty用シンタックスファイル

http://svn.textmate.org/trunk/Bundles/PHP%20Smarty.tmbundle/Syntaxes/Smarty.plist

C:\ユーザー名\AppData\Roaming\Sublime Text 2\Packages\User\Smarty.tmLanguage
に配置。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment