0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

小ネタ: Breakキーが無いパソコンでSublime TextのCancel Build(Ctrl+Breakキー)を実行する

Posted at

困ったこと

環境:Thinkpad X230 on Windows 7
Sublime Text3上Python/Flaskで開発をしてます。Flaskサーバーの起動・停止をいちいちコマンドから行うのは面倒なのでショートカット・キーで行いたいと思いました。

Sublime TextのBuild Systemのショートカットでは、
image

  • Buiild (私的にはFlaskの始動)はCtrl+Bで一発なのですが
  • Cancel Build(同 Flaskの停止)はCtrl+Breakです。私のPCのキーボードにはBreakキーが無いのでショートカットが入力できません。。。

image

  • メニューからの操作ならできますけど、面倒だなあ。

解決策 - Sublime Text3のキーのバインディングを変える

同じようなことで悩んだ方はいろいろおられました
CTRL + BREAK doesn’t stop Build in Windows 7

「Preference」-「Key Bindings」で
image

右側のパネル1に以下の内容2を記入します。

{"keys": "ctrl+shift+b"], "command": "exec", "args": {"kill": true} }

image

すると登録したショートカット・キーが有効になり、Flaskが停止できます。

image

ちなみにこのウインドウ自体を消したければWindows7では**「Esc」キー**です。

以上です。

  1. Default(Windows).Sublime-keymap

  2. 釈迦説でしょうが、キーの割り当てはお好きにどうぞ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?