設定したのは下記の通り
一番悩んだのは変換系。
一番上の
alt+0
が結構悩んだ。
変換したい文章を選んで
alt+0
すると
0px
なら
0
にするというものだが、前提として最初は
0px 0px 0px 0px
にしてる、という形。
試行錯誤するのに
px
がないと面倒なので作業中は
px
ありで作業して最後に
0px
なら
0
にしたいし、
0 0 0 0
も不格好だから0が4つ並ぶ時は0一つにしたい。
そういう思いを形にするやつ。
変換内容は
0 0 0 0
または
0px 0px 0px 0px
または
0px
は
0
にする、という命令文。
変換したあとは選択がなくなってカーソルが最後になるけど、本当は返還後もそのまま選択したままになってほしい。
でもどうしていいのかわからん。
あとワンアクションで下に続く全角から半角、半角の~を全角の〜に変換したいけどそれもどうやっていいのかわからんっていう・・・
このあたりはミミカキエディタは簡単なのが用意されてたのにVScodeでは無いのは納得いかない。
ちなみに二つ目の
zenkaku-hankaku.zenhanAlphaNumSymbol
は
Zenkaku-Hankaku
というプラグインがないと動かないやつ。
[
{
"key": "alt+0",
"command": "editor.action.insertSnippet",
"args": {"snippet": "${TM_SELECTED_TEXT/ 0 0 0 0| 0px 0px 0px 0px| 0px/ 0/g}" },
"when": "editorTextFocus || editorLangId == 'css' || editorLangId == 'less'"
},
{
"key": "alt+h",
"command": "zenkaku-hankaku.zenhanAlphaNumSymbol",
"args": {"snippet": "${TM_SELECTED_TEXT}" },
"when": "editorTextFocus || editorLangId == 'css' || editorLangId == 'less' || editorLangId == 'html'"
},
{
"key": "alt+-",
"command": "editor.action.insertSnippet",
"args": {"snippet": "${TM_SELECTED_TEXT/~/〜/g}" },
"when": "editorTextFocus || editorLangId == 'css' || editorLangId == 'less'"
},
{
"key": "ctrl+b",
"command": "type",
"args": { "text": "border: 1px solid #858a8e;" },
"when": "editorLangId == 'css' || editorLangId == 'less'"
},
{
"key": "ctrl+c",
"command": "type",
"args": { "text": "background-color: #b1d131;" },
"when": "editorTextFocus || editorLangId == 'css' || editorLangId == 'less'"
},
{
"key": "ctrl+m",
"command": "type",
"args": { "text": "margin: 0px 0px 0px 0px;\npadding: 0px 0px 0px 0px;" },
"when": "editorLangId == 'css' || editorLangId == 'less'"
},
{
"key": "ctrl+a",
"command": "editor.action.insertSnippet",
"args": {"snippet": "${TM_SELECTED_TEXT}" },
"when": "editorTextFocus || editorLangId == 'html'"
},
{
"key": "ctrl+b",
"command": "editor.action.insertSnippet",
"args": {"snippet": "${TM_SELECTED_TEXT}" },
"when": "editorLangId == 'html'"
},
{
"key": "ctrl+d",
"command": "editor.action.insertSnippet",
"args": {"snippet": "${TM_SELECTED_TEXT}
" },
"when": "editorLangId == 'html'"
},
{
"key": "ctrl+l",
"command": "editor.action.insertSnippet",
"args": {"snippet": "" },
"when": "editorLangId == 'html'"
},
{
"key": "ctrl+p",
"command": "editor.action.insertSnippet",
"args": {"snippet": "
${TM_SELECTED_TEXT}
" },
"when": "editorLangId == 'html'"
},
{
"key": "ctrl+r",
"command": "editor.action.insertSnippet",
"args": {"snippet": "
\n\n\n
" },
"when": "editorLangId == 'html'"
},
{
"key": "ctrl+s",
"command": "editor.action.insertSnippet",
"args": {"snippet": "
${TM_SELECTED_TEXT}" },
"when": "editorLangId == 'html'"
},
{
"key": "ctrl+u",
"command": "editor.action.insertSnippet",
"args": {"snippet": "
${TM_SELECTED_TEXT}" },
"when": "editorLangId == 'html'"
},
{
"key": "ctrl+t",
"command": "editor.action.insertSnippet",
"args": {"snippet": "
" },
"when": "editorLangId == 'html'"
},
{
"key": "shift+enter",
"command": "editor.action.insertSnippet",
"args": {"snippet": "
\n" },
"when": "editorTextFocus || editorLangId == 'html'"
},
{
"key": "shift+alt+f",
"command": "-filesExplorer.findInFolder",
"when": "explorerResourceIsFolder && explorerViewletVisible && filesExplorerFocus && !inputFocus"
},
{
"key": "shift+alt+f",
"command": "-notebook.format",
"when": "notebookEditable && !editorTextFocus && activeEditor == 'workbench.editor.notebook'"
},
{
"key": "shift+alt+f",
"command": "-editor.action.formatDocument.none",
"when": "editorTextFocus && !editorHasDocumentFormattingProvider && !editorReadonly"
},
]