Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ahahaFx/b3fdab2b073c222d671f to your computer and use it in GitHub Desktop.
Save ahahaFx/b3fdab2b073c222d671f to your computer and use it in GitHub Desktop.
// Place your key bindings in this file to overwrite the defaults
// https://code.visualstudio.com/docs/customization/keybindings
[
//---- 他の方のを流用 ----
// http://tonbi.jp/Web/Diary/030/
// ↑up
{ "key": "ctrl+e", "command": "cursorUp",
"when": "editorTextFocus" },
{ "key": "shift+ctrl+e", "command": "cursorUpSelect",
"when": "editorTextFocus" },
{ "key": "ctrl+e", "command": "showPrevParameterHint",
"when": "editorTextFocus && parameterHintsVisible" },
{ "key": "ctrl+e", "command": "selectPrevQuickFix",
"when": "editorFocus && quickFixWidgetVisible" },
{ "key": "ctrl+e", "command": "selectPrevSuggestion",
"when": "editorTextFocus && suggestWidgetVisible" },
// ←left
{ "key": "ctrl+s", "command": "cursorLeft",
"when": "editorTextFocus" },
{ "key": "shift+ctrl+s", "command": "cursorLeftSelect",
"when": "editorTextFocus" },
// →right
{ "key": "ctrl+d", "command": "cursorRight",
"when": "editorTextFocus" },
{ "key": "shift+ctrl+d", "command": "cursorRightSelect",
"when": "editorTextFocus" },
// ↓down
{ "key": "ctrl+x", "command": "cursorDown",
"when": "editorTextFocus" },
{ "key": "shift+ctrl+x", "command": "cursorDownSelect",
"when": "editorTextFocus" },
{ "key": "ctrl+x", "command": "showNextParameterHint",
"when": "editorTextFocus && parameterHintsVisible" },
{ "key": "ctrl+x", "command": "selectNextQuickFix",
"when": "editorFocus && quickFixWidgetVisible" },
{ "key": "ctrl+x", "command": "selectNextSuggestion",
"when": "editorTextFocus && suggestWidgetVisible" },
// -----------------------------
// Original
{ "key": "alt+f alt+s", "command": "workbench.action.files.save" },
{ "key": "ctrl+f", "command": "cursorWordRight",
"when": "editorTextFocus" },
{ "key": "ctrl+a", "command": "cursorWordLeft",
"when": "editorTextFocus" },
{ "key": "ctrl+q ctrl+d", "command": "cursorEnd",
"when": "editorTextFocus" },
{ "key": "ctrl+q ctrl+s", "command": "cursorHome",
"when": "editorTextFocus" },
// 検索・置換
{ "key": "ctrl+q ctrl+f", "command": "actions.find" },
{ "key": "ctrl+q ctrl+a", "command": "editor.action.startFindReplaceAction" },
// コピー&ペースト
{ "key": "ctrl+k ctrl+k", "command": "editor.action.clipboardCopyAction"} ,
{ "key": "ctrl+k ctrl+y", "command": "editor.action.clipboardCutAction" },
{ "key": "ctrl+k ctrl+v", "command": "editor.action.clipboardPasteAction" },
{ "key": "ctrl+k ctrl+b", "command": "cursorRightSelect",
"when": "editorTextFocus" },
// 挿入・削除
{ "key": "ctrl+h", "command": "deleteLeft",
"when": "editorTextFocus" },
{ "key": "ctrl+g", "command": "deleteRight",
"when": "editorTextFocus" },
{ "key": "ctrl+r", "command": "cursorPageUp",
"when": "editorTextFocus" },
{ "key": "ctrl+c", "command": "cursorPageDown",
"when": "editorTextFocus" },
{ "key": "ctrl+q ctrl+r", "command": "cursorTop",
"when": "editorTextFocus" },
{ "key": "ctrl+q ctrl+c", "command": "cursorBottom",
"when": "editorTextFocus" },
{ "key": "ctrl+q ctrl+y", "command": "deleteAllRight",
"when": "editorTextFocus" },
{ "key": "ctrl+y", "command": "editor.action.deleteLines",
"when": "editorTextFocus" },
{ "key": "ctrl+n", "command": "editor.action.insertLineBefore",
"when": "editorTextFocus" },
{ "key": "ctrl+m", "command": "lineBreakInsert",
"when": "editorTextFocus" },
{ "key": "ctrl+i", "command": "tab",
"when": "editorTextFocus" },
{ "key": "ctrl+shift+i", "command": "outdent",
"when": "editorTextFocus"},
// 選択中のカーソル移動
{ "key": "ctrl+d", "command": "cursorRightSelect",
"when": "editorHasSelection" },
{ "key": "ctrl+s", "command": "cursorLeftSelect",
"when": "editorHasSelection" },
{ "key": "ctrl+e", "command": "cursorUpSelect",
"when": "editorHasSelection" },
{ "key": "ctrl+x", "command": "cursorDownSelect",
"when": "editorHasSelection" },
{ "key": "ctrl+f", "command": "cursorWordRightSelect",
"when": "editorHasSelection" },
{ "key": "ctrl+a", "command": "cursorWordLeftSelect",
"when": "editorHasSelection" },
{ "key": "ctrl+q ctrl+d", "command": "cursorEndSelect",
"when": "editorHasSelection" },
{ "key": "ctrl+q ctrl+s", "command": "cursorHomeSelect",
"when": "editorHasSelection" },
{ "key": "ctrl+r", "command": "cursorPageUpSelect",
"when": "editorHasSelection" },
{ "key": "ctrl+c", "command": "cursorPageDownSelect",
"when": "editorHasSelection" },
{ "key": "ctrl+q ctrl+r", "command": "cursorTopSelect",
"when": "editorHasSelection" },
{ "key": "ctrl+q ctrl+c", "command": "cursorBottomSelect",
"when": "editorHasSelection" },
]
@ahahaFx
Copy link
Author

ahahaFx commented Nov 25, 2015

Visual Studio Code(VS Code)用 WordStarライクなキーアサイン(Keyboard Shortcuts)です。
自分の期待と異なる箇所は、以下の通り。

1.選択開始時に、現在のカーソル位置の右の文字が選択される
2.選択状態からコピーした場合、選択状態が解除されない

■ 設定方法
メニュー「File」/「Preferences」/「Keyboard Shortcuts」
右側に表示されている空の「keybindings.json」にこの内容をペーストする。

@mkeveney
Copy link

Big thanks for publishing this! Saved me a lot of time.

@SinisaMil
Copy link

There is an even better Wordstar emulation for Code. It is here: https://github.com/SinisaMil/Sinisa_Hack

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment