如何为 MacVim 创建骨架文件或模板

发布于 2024-09-25 11:11:30 字数 261 浏览 0 评论 0原文

我看过有关在 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

执着的年纪 2024-10-02 11:11:30

我觉得给出这个答案很肮脏(因为我从来没有这样做过),但是谷歌给了我这个: 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.

月竹挽风 2024-10-02 11:11:30

有许多 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文