PHP block shortcut in Visual Studio Code

守給你的承諾、 提交于 2019-12-06 15:06:15

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!