Sublime text 3のインストール(ubuntu14.04, Windows8.1)

vimにそろそろ限界を感じてきたので、Sublime text3に変更を試みた。
vimに特に大きな不満があるわけでないし、サーバでの作業も簡単にできる点で非常にありがたいけど、
だからといってvimの変態的なカスタマイズを突き詰めるよりは、もっとモダンなエディタで自動プラグインによる管理のほうが効率的だろうと判断した。


インストールしたsublimeに対して行った設定を列挙する。

  • Package Controlのインストール

view-show consoleを選択
Installation - Package Control
の中のpythonコマンドを全てコンソールに打ち込む。何度か再起動を求められるので、そのたびに同様の操作を繰り替えすといつの間にか入っている。
これでCtr+shift+pでパッケージのインストールが簡単にできるようになる。

  • テーマ

package installで早速theme flatlandを選択。

Preferences settings-Userを
{
"default_encording": "UTF-8",
"draw_white_space": "all",
"fallback_encording": "UTF-8",
"font_face": "Consolas",
"font_size": 12,
"highlight line": true,
"ignored_packages":
[
],
"line_padding_top": 3,
"show_encording": true,
"tab size": 4,
"theme": "Flatland Dark.sublime-theme",
"color_scheme": "Packages/Theme - Flatland/Flatland Monokai.tmTheme",
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
"vintage_ctrl_keys": true,
"vintage_start_in_command_mode": true,
"vintage_use_clipboard": true,
"word wrap": true
}
とする。
追記(20160121):
こっちのほうが最新版で格好いいので変更した。
m.designbits.jp


ついでにPreferencesのKey Bindings-Userを
[
// タブの切り替え
{ "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" }
]
},
// インサートモードから抜ける
{ "keys": ["ctrl+j"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
{ "keys": ["j","j"], "command": "exit_insert_mode",
"context":
[
{ "key": "setting.command_mode", "operand": false },
{ "key": "setting.is_widget", "operand": false }
]
},
// ビジュアルモードから抜ける
{ "keys": ["ctrl+j"], "command": "exit_visual_mode",
"context":
[
{ "key": "setting.command_mode"},
{ "key": "num_selections", "operand": 1},
{ "key": "selection_empty", "operator": "equal", "operand": false, "match_all": false }
]
},
{ "keys": ["ctrl+shift+c"], "command": "clang_format" },
]
とする。

  • 日本語を使用するため、下記に沿う作業を行う(Ubuntuのみ)。

Linux での日本語入力設定 [Sublime Text 3 の参考書(実践編)Wiki]


All Autocomplete
BracketHighter
C++ Snippets

Clang Format
Clang Formatの実行ファイルへパスを通す必要がある。
github.com

ConvertToUTF8
IMESupport
MinimalFortran
SideBarEnhancements
Smart Delete

この動作の前にCppcheckをインストールしておくこと。
SublimeLinter
SublimeLinter-cppcheck
windowsの場合はそれぞれ下記を参考に。
How to do it — C++ Starting Kit Project - Guide 0.0.1 documentation

SyncedSlideBar
Terminal
TrailingSpaces
preferences-package settings-trailing spaces-settings-Userを選択し、下記を記入
{
"trailing_spaces_regexp": " |[ \t]+",
"trailing_spaces_highlight_color": "comment"
}

参考
Sublime Text 3でインストールしているプラグイン - プログラミングとかLinuxとかの備忘録
【Sublime Text】愛好家必読!Vim化しよう - 悲しいけど、オレ素人プログラマなのよね

ubuntuWindowsの同期を試みたが失敗した。まあ仕方ないか。