Visual Studio Code 中的 PHP 块快捷方式 [英] PHP block shortcut in Visual Studio Code

查看:61
本文介绍了Visual Studio Code 中的 PHP 块快捷方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道我的问题很简单,但是如何在 VSCode 中打开基本的 php 块,就像这样 - <?php ?>?在 Sublime 中,我只需输入 php 并按 Tab,就创建了块.但是找不到与 VSCode 相同的快捷方式.

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.

推荐答案

您可以向 Visual Studio Code 添加自定义用户代码段:

You can add a custom user snippet to Visual Studio Code:

  • 打开偏好设置"
  • 用户片段
  • 选择html.json (HTML)
  • 粘贴以下自定义代码段:

  • Open "Preferences"
  • User Snippets
  • Select html.json (HTML)
  • Paste the following custom snippet:

"php": {
    "prefix": "php",
    "body": [ "<?php $1 ?>" ],
    "description": "php tag"
}

这篇关于Visual Studio Code 中的 PHP 块快捷方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆