如何为 MacVim 创建骨架文件或模板
我看过有关在 vim 中创建“骨架”文件的说明。这涉及创建文件,将其命名为“tmpl”加上您要定位的文件类型的扩展名(例如:tmpl.html),将其保存到“骨架”目录,然后编辑 vimrc 文件。
但是,在 MacVim 中,我在任何地方都没有看到“骨架”目录。谷歌搜索等没有返回任何有用的信息。
有人可以给我指点有用的教程/白皮书/其他内容来引导我完成 MacVim 的这个过程吗?
我决心发展一些使用 Vim/MacVim 的技能!
谢谢
I have seen instructions about creating a "skeleton" file in vim. This involves creating the file, naming it "tmpl" plus the extension of the file type you are targeting (ex: tmpl.html), saving it to the "skeleton" directory, and then editing the vimrc file.
But, in MacVim, I don't see a "skeleton" directory anywhere. Googling, etc., has returned no helpful information.
Can someone point me to a helpful tutorial/white paper/whatever to walk me through this process for MacVim?
I am determined to develop some skills with Vim/MacVim!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我觉得给出这个答案很肮脏(因为我从来没有这样做过),但是谷歌给了我这个: Vim 食谱:使用模板。
似乎您创建了自己的骨架目录并将
.vimrc
文件的行指向它。I feel dirty giving this as an answer (because I've never done it), but googlin' gave me this: Vim Recipes: Using Templates.
Seems like you make your own skeleton directory and point the line for your
.vimrc
file to it.有许多 vim 插件可以处理此任务。我使用 snipMate 来执行这样的任务。您可以为每种文件类型或全局定义片段。关于片段的最好的部分是,当它带您到片段中的每个“变量”时,您可以继续点击选项卡,以便您可以快速填写缺少的信息。
There are a multitude of vim plugins that can handle this task. I use snipMate to perform tasks like this. You can define snippets for each file type or globally. The best part about the snippets is that you can keep hitting tab while it takes you to each "variable" within the snippet so that you can fill in the missing information quickly.