0
是否有一种简单的方法可以让我在每次创建.html
文件时自动加载正常标题vim
?自动加载标题页
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
是否有一种简单的方法可以让我在每次创建.html
文件时自动加载正常标题vim
?自动加载标题页
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
The content of the document......
</body>
</html>
您之后的关键字是“模板”。
请参阅:h template
。
你会找到关于如何在你的.vimrc中启动的解释。但是,这将是一个简单(高效)的解决方案,不会自动计算内容。搜索适合您的template expander plugin,如果这是您想要的。
有些人喜欢根据需要(而不是自动)加载这些模板,因此他们非常满意片段插件。一些插件可以同时执行(需求片段和新文件模板)。
无论如何,我很确定这个问题已经在这里或vi.SE上有答案。它可能不是关于HTML,而是关于LaTeX,C,php ...,但是在任何情况下,通用解决方案都适用。
你可以试试[emmet-vim](https://vimawesome.com/plugin/emmet-vim)插件。 – ryuichiro