LoginSignup
7
7

More than 5 years have passed since last update.

VisualStudioCodeでSublimeライクなショートカットの設定

Last updated at Posted at 2015-05-25
  • 15.06.03 v0.3 Update cmd+dでSublimeの同一テキストをマルチカーソルで編集機能が追加されました。

やり方

ショートカットの編集はメニューから選択
[Code] -> [Preferences] -> [Keyboard Shortcuts]

以下コピペできます。for Mac

keybindings.json


// Place your key bindings in this file to overwrite the defaults
[ 
// 選択中のテキストから次の同一テキスト1箇所にマルチカーソル  (default)
{ "key": "cmd+d",                "command": "editor.action.addSelectionToNextFindMatch",
                                 "when": "editorTextFocus" },

// ブロックコメントの追加
{ "key": "cmd+ctrl+/",           "command": "editor.action.blockComment",
                                 "when": "editorTextFocus" }, 

// 行の複製
{ "key": "cmd+shift+d",          "command": "editor.action.copyLinesDownAction",
                                 "when": "editorTextFocus" },
// 行の移動下方向
{ "key": "cmd+ctrl+down",        "command": "editor.action.moveLinesDownAction",
                                 "when": "editorTextFocus" },
// 行の移動上方向
{ "key": "cmd+ctrl+up",          "command": "editor.action.moveLinesUpAction",
                                 "when": "editorTextFocus" },

// 選択テキストで検索して全ての対象の末尾にマルチカーソル             
{ "key": "cmd+ctrl+g",           "command": "editor.action.selectHighlights",
                                 "when": "editorTextFocus" },
// コンテキストメニュー表示
{ "key": "cmd+ctrl+enter",       "command": "editor.action.showContextMenu",
                                 "when": "editorTextFocus" }  


]



他PCとの設定共有

設定ファイルは以下のパスに保存されているので、シンボリックリンク貼ってドロップボックス共有すれば他のPCとも同期できるはず。(未確認)

/Users/[YOUR USER NAME]/Library/Application Support/Code/User/keybindings.json
/Users/[YOUR USER NAME]/Library/Application Support/Code/User/settings.json

7
7
1

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