SublimeTextで一つのキーバインドで複数のコマンドを実行
SublimeTextで一つのキーバインドで複数のコマンドを実行するプラグインを見つけました。
sublime-text-multiple-commands
色々応用できて便利そうですね。
Sidebarの操作をdirex+popwin的にする
emacsではディレクトリをSublimeTextのsidebar的にツリー構造で表示してファイルを選択できるdirexというパッケージがあります。
これとpopwinと組み合わせる事で選択し終えたらそのウィンドウを閉じるという事が出来、非常に便利です。
それっぽい動作をSublimeTextでも出来ないかとmultiple-commandsを使ってやってみました。
単純にキーバインドを追加するだけです。
{
"keys": ["ctrl+x", "ctrl+j"],
"command": "run_multiple_commands",
"args": {
"commands": [
{"command": "toggle_side_bar", "context": "window"},
{"command": "focus_side_bar", "context": "window"}
]
},
"context": "window"
},
{
"keys": ["enter"],
"command": "toggle_side_bar",
"context": [{"key": "control", "operand": "sidebar_tree"} ]
},
C-x C-jでsidebarが開き、enterで選択し終えたらSidebarが閉じてくれます。便利ですね。