Skip to content

Instantly share code, notes, and snippets.

@joemaller
Created May 29, 2026 13:49
Show Gist options
  • Select an option

  • Save joemaller/007ae162e20ca963368b44ef246e10ef to your computer and use it in GitHub Desktop.

Select an option

Save joemaller/007ae162e20ca963368b44ef246e10ef to your computer and use it in GitHub Desktop.
moving some VS Code keybindings and tasks from MacOS over to Omarchy Linux
// Place your key bindings in this file to overwrite the defaultsauto[]
[
// Format PHP files with `npx iop-html-php-prettier` via task
{
"key": "shift+alt+f",
"command": "workbench.action.tasks.runTask",
"when": "editorTextFocus && editorLangId == php",
"args": "Format PHP with Prettier",
},
// Format and optimize SVG files with SVGO via task
{
"key": "shift+alt+f",
"command": "workbench.action.tasks.runTask",
"when": "editorTextFocus && resourceExtname == .svg",
"args": "Optimize with SVGO",
},
// Format CSS and SCSS using Stylelint autofix
{
"key": "shift+alt+f",
"command": "stylelint.executeAutofix",
"when": "editorTextFocus && (resourceExtname == .css || resourceExtname == .scss)",
},
// Custom keybinding for formatting WP Block Patterns
// limited to wp-content/themes/*/patterns/*.php files
{
"key": "shift+alt+f",
"command": "workbench.action.tasks.runTask",
"when": "editorTextFocus && editorLangId == php && resourcePath =~ /wp-content\\/themes\\/[^\\/]+\\/patterns\\/.*\\.php/",
"args": "Format WP Block Patterns",
},
{
"key": "shift+enter",
"command": "-python.execInREPL",
"when": "config.python.REPL.sendToNativeREPL && editorTextFocus && !isCompositeNotebook && !jupyter.ownsSelection && !notebookEditorFocused && editorLangId == 'python'",
},
{
"key": "shift+enter",
"command": "-python.execSelectionInTerminal",
"when": "editorTextFocus && !findInputFocussed && !isCompositeNotebook && !jupyter.ownsSelection && !notebookEditorFocused && !replaceInputFocussed && editorLangId == 'python'",
},
]
{
"version": "2.0.0",
"tasks": [
{
"label": "Prettier: PHP as HTML",
"type": "shell",
"command": "npx",
"args": ["prettier", "--write", "--parser", "html", "${file}"],
"presentation": {
"reveal": "never",
"showReuseMessage": false,
},
},
{
"label": "Prettier: PHP",
"type": "shell",
"command": "npx",
"args": ["prettier", "--write", "${file}"],
"presentation": {
"reveal": "never",
"showReuseMessage": false,
},
},
// {
// "label": "Format PHP with Prettier",
// // "dependsOn": ["Prettier: PHP as HTML", "Prettier: PHP"],
// "dependsOn": [ "Prettier: PHP"],
// "dependsOrder": "sequence",
// "presentation": {
// "reveal": "never",
// "showReuseMessage": false
// }
// }
// {
// "label": "Format PHP with Prettier (npx)",
// "type": "shell",
// "command": "npx",
// "args": ["iop-html-php-prettier", "${file}"],
// "presentation": {
// "reveal": "always",
// "showReuseMessage": false
// }
// },
// {
// // Until this is it's own package, global install @ideasonpurpose/build-tools-wordpress
// // NOTE nvm is not available to non-interactive shells, so use zsh -c "source ~/.zshrc && command"
// // This is only necessary for globally installed files. It should work
// // for locally installed packages.
// "label": "Format PHP with Prettier",
// "type": "shell",
// "command": "zsh",
// "args": ["-c", "source ~/.zshrc && iop-html-php-prettier ${file}"],
// "presentation": {
// "reveal": "never",
// "showReuseMessage": false,
// },
// },
{
// Copy of above...
// The binary installs with @ideasonpurpose/build-tools-wordpress,
// so npx should work nvm is not available to non-interactive shells, so use zsh -c "source ~/.zshrc && command"
// This is only necessary for globally installed files. It should work
// for locally installed packages.
"label": "Format PHP with Prettier",
"type": "shell",
"command": "npx",
"args": ["iop-html-php-prettier", "${file}"],
"presentation": {
"reveal": "never",
"showReuseMessage": false,
},
},
{
"label": "Optimize with SVGO",
"type": "shell",
"command": "npx",
"args": ["svgo", "${file}"],
"presentation": {
"reveal": "never",
"showReuseMessage": false,
},
},
{
// Restrict this to wp-content/themes/*/patterns/**/*.php
"label": "Format WP Block Patterns",
"type": "shell",
"command": "npx",
"args": ["iop-format-wp-block-pattern", "${file}"],
"presentation": {
"reveal": "never",
"showReuseMessage": false,
},
},
],
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment