记事本++预制片段
我在视频中看到,人们通过输入“html:5”或类似的内容来获取 html 模板(顺便说一句,他们没有使用 notepad++)。这在记事本++中可以吗?谢谢。
I have seen in videos, that people get html template by typing "html:5" or something like that (btw, they're not using notepad++). Is this possible in notepad++? Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
有点晚了,但你正在寻找的是禅宗编码。
Google 托管的 Zen Coding 项目有一个 NotePad++ 插件 这应该完全符合您的需要。
例如,输入如下内容:
后跟 Ctrl + E,展开为:
A little late, but what you're looking for is called Zen Coding.
The Zen Coding project hosted on Google has a plugin for NotePad++ that should do exactly what you need.
For example, entering something like:
Followed by Ctrl + E, expands into:
现在它在 Notepad++ 中称为 Emmet 插件,
只需输入 html:5 并按 control + alt + Enter
您将得到以下标记:
Now it's called Emmet plugin in Notepad++
Just type html:5 and press control + alt + enter
and you will get the following markup:
选项 1
安装并使用 Notepad++ Snippets 插件。
选项 2
如果您没有管理员访问权限或位于防火墙后面,则存在宏黑客攻击。
如果您的模板有点短,那么您可以使用内置的宏并手动键入模板文本(每个模板一次性操作)。然后,您可以“保存当前录制的宏”并为您创建的每个新文件重播它。 Emmet 仅适用于 html,但此技术适用于任何类型的文本(只要您可以手动键入文本)
注意:您无法在录制时复制粘贴(Ctrl-C/Ctrl-V)文本。复制粘贴当前剪贴板的内容,这是不可取的!
对于那些喜欢分步说明的人:
Option 1
Install and use the Notepad++ Snippets plugin.
Option 2
If you don't have admin access or behind a firewall, there is a Macro hack.
If your template is a bit short, then you can use the built-in MACRO and manually key in the template text (a one-time operation per template). You can then "Save Current Recorded Macro" and replay it for every new file that you create. Emmet works only for html, but this technique works for any kind of text(as long as you can manually key-in the text)
Note: You cannot copy-paste (Ctrl-C/Ctrl-V) text while recording as it will copy-paste current clipboard's contents which is undesirable!
For those who like step-by-step instructions:
使用 NP++v6.1.4,我可以很快地完成此操作:
现在,只需输入!并按 ctrl-alt-enter。
Using NP++v6.1.4, I got this to work pretty quickly doing this:
Now, just type ! and hit ctrl-alt-enter.
您可以使用 QuickText 创建您自己的模板。似乎不再支持 QuickText,但它仍然有效,只是文档中有一些错误的内容。
You can use QuickText to create your own templates. It seems that QuickText isn't supported anymore, but it still works, the documentation just has some wrong content.
我使用一个名为 Ditto 的程序,它就像所有复制粘贴材料的剪贴板。我把预先写好的语法固定在那里。它有帮助。
I use a program called Ditto, it's like a clipboard of all your copy-paste material. I have my prewritten syntax in there pinned. It helps.
实际上,这称为标记代码。尽管“禅宗编码”正在取代标记而变得众所周知,但它是为代码构建结构的原始术语;这使得其他人更容易阅读。
就 Notepad++ 的模板而言,恐怕很难找到公共的、定制的模板。尽管该程序确实附带了定制模板(例如 Hello Kitty 模板),但您最好的选择是询问在线编程社区中的人员。
我个人最喜欢的是 DreamInCode,他们提供帮助和支持,以及有关许多不同计算机编程的信息丰富的教程和网络开发语言。我相信,如果您找不到您喜欢的内容(如果有的话),有人会很乐意为您提供帮助。
In actuality, it is called marking up your code. Although "zen coding" is becoming well known in place of markup, it is the original term for building a structure for your code; which makes it easier for others to read.
As far as the template thing goes for Notepad++, I'm afraid that it is difficult to find public, custom made templates. Although the program does come with custom made templates, such as the Hello Kitty template, your best bet would be to ask people in online programming communities.
My personal favorite is DreamInCode, where they offer help and support, as well as pretty informative tutorials on numerous different computer programming and web development languages. I'm confident that if you can't find one you like that has been posted there, if any, someone would be glad to help you.