Sublime Text 2 评论/文档块
最近,我决定尝试使用 Sublime Text 2 作为 TextMate 的替代品(确实如此)。我非常喜欢它,但唯一让我烦恼的问题是,按“Enter”键后它不会继续 PHP 注释/文档块。
它只是添加新的空行而不是以“*”开头的行,如下所示 http://cl.ly/AFcP/o
有解决方案吗?我尝试为其进行按键绑定,但这对我来说太复杂了,特别是因为我对编辑器不太有经验。
提前致谢。
Recently, I decided to try out Sublime Text 2 as a TextMate alternative (which it is). I'm absolutely loving it but the only issue that bugs me is that it doesn't continue the PHP Comment/Doc Block upon pressing "Enter".
It just adds new blank lines instead of lines starting with "* " as seen here http://cl.ly/AFcP/o
Is there a solution to this? I tried doing a key binding for it but it was just too complicated for me, especially because I'm not too experienced with the editor.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
现在有了更好的解决方案:
https://github.com/spadgos/sublime-jsdocs
它被称为DocBlockr,并且它有 PHPDoc 支持。它根据函数参数自动添加文档块。好的...
And now an even better solution has become available:
https://github.com/spadgos/sublime-jsdocs
It is called DocBlockr, and it has PHPDoc support. It automatically adds the doc block based on the function parameters. Nice...
刚刚遇到了同样的问题,写了一个小片段。由于它是一个键绑定,因此必须存储在 .sublime-keymap 文件中。如果您使用的是 Mac,只需转到 Sublime Text 2 >首选项>键绑定 - 用户或其他操作系统上的类似键。
这是我的代码:
Just had the same problem and wrote a little snippet. Since it is a keybinding it has to be stored in a .sublime-keymap File. If you're on a Mac just goto Sublime Text 2 > Preferences > Key Bindings - User or similar on some other OS.
Here is my Code: