36
37

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.

Sublime Text でEmacs的なキーバインドを設定する

Posted at

Sublime Text でEmacs 的なキーバインドを設定する

  • 下記を開く

  • Preferences > Key Bindings- User

  • 下記の通り設定

json
[
    // 右移動(Ctrl + F)
    { "keys": ["ctrl+f"], "command": "move", "args": {"by": "characters", "forward": true } },
    // 左移動(Ctrl + D)
    { "keys": ["ctrl+b"], "command": "move", "args": {"by": "characters", "forward": false } },
    // 上移動(Ctrl + P)
    { "keys": ["ctrl+p"], "command": "move", "args": {"by": "lines", "forward": false } },
    // 下移動(Ctrl + N)
    { "keys": ["ctrl+n"], "command": "move", "args": {"by": "lines", "forward": true } },
    // 左削除(Ctrl + H)
    { "keys": ["ctrl+h"], "command": "left_delete" },
    // 右削除(Ctrl + D)
    { "keys": ["ctrl+d"], "command": "right_delete" },
    // 行の先頭へ移動(Ctrl + A)
    { "keys": ["ctrl+a"], "command": "move_to", "args": {"to": "bol", "extend": false} },
	// 行の末尾へ移動(Ctrl + E)
    { "keys": ["ctrl+e"], "command": "move_to", "args": {"to": "eol", "extend": false} },


    // 上記の設定のせいで上書きされたコマンドを、Ctrl+Shift で復活させる 
    // 全選択(Ctrl + Shift + A)
    { "keys": ["ctrl+shift+a"], "command": "select_all" },
    // 同じ文字を一括選択・一括編集(Ctrl + Shift + D)
    { "keys": ["ctrl+shift+d"], "command": "find_under_expand" },
    // 選択行のコピー(Ctrl + Shift + V)
	{ "keys": ["ctrl+shift+v"], "command": "duplicate_line" },
    // 検索(Ctrl + Shift + F)
    { "keys": ["ctrl+shift+f"], "command": "show_panel", "args": {"panel": "find", "reverse": false} },
    // 新規タブ(Ctrl + Shift N)
    { "keys": ["ctrl+shift+n"], "command": "new_file" },

]


  • 一部の設定はSublimeTextの再起動を行わないと反映されないかも

  • 個人的に必要なコマンドは Ctrl + ~ で上書きしちゃったショートカットは Ctrl + Shift + ~ で復活させてるイメージ

  • 下記、デフォルトのキーバインドを参考にすれば結構簡単に設定できる

  • Preferences > Key Bindings- Default

36
37
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
36
37

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?