如何在 Vim 中快速关闭 HTML 标签? [英] How can one close HTML tags in Vim quickly?

查看:16
本文介绍了如何在 Vim 中快速关闭 HTML 标签?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经有一段时间没有在 Vim 中编写任何类似 HTML 的代码了,但最近我又遇到了这个问题.假设我正在编写一些简单的 HTML:

It's been a while since I've had to do any HTML-like code in Vim, but recently I came across this again. Say I'm writing some simple HTML:

<html><head><title>This is a title</title></head></html>

如何快速写下标题、标题和 html 的结束标签?我觉得我在这里错过了一些非常简单的方法,不需要我将它们一一写下来.

How do I write those closing tags for title, head and html down quickly? I feel like I'm missing some really simple way here that does not involve me going through writing them all down one by one.

当然,我可以使用 CtrlP 来自动完成各个标签名称,但让我在笔记本电脑键盘上使用的实际上是正确使用括号和斜线.

Of course I can use CtrlP to autocomplete the individual tag names but what gets me on my laptop keyboard is actually getting the brackets and slash right.

推荐答案

看看这个..

closetag.vim

closetag.vim

Functions and mappings to close open HTML/XML tags

https://www.vim.org/scripts/script.php?script_id=13

我使用类似的东西.

这篇关于如何在 Vim 中快速关闭 HTML 标签?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆