问题
I know my question is simple, but how to open basic php block in VSCode, like so - <?php ?>
?
In Sublime I simply type php and press Tab, and the block created. But can't find the same shortcut for VSCode.
回答1:
You can add a custom user snippet to Visual Studio Code:
- Open "Preferences"
- User Snippets
- Select html.json (HTML)
Paste the following custom snippet:
"php": { "prefix": "php", "body": [ "<?php $1 ?>" ], "description": "php tag" }
回答2:
Use extension "Sublime Text Keymap for VS Code" https://marketplace.visualstudio.com/items?itemName=ms-vscode.sublime-keybindings
来源:https://stackoverflow.com/questions/48624475/php-block-shortcut-in-visual-studio-code