vim - 如何在 vim 缩写中转义字符?
问题描述
我试图在我的 Vimrc 中使用这个缩写来进行降价编辑:
iabbrev ,,img ![<alt-text>](<img-link>)
我认为括号需要在这里转义,但我不确定如何在不包括缩写中的转义字符的情况下转义这些字符。
我应该怎么办?
解决方案
缩写有以下形式(见:h abbreviations
):
There are three types of abbreviations:
full-id The "full-id" type consists entirely of keyword characters (letters
and characters from 'iskeyword' option). This is the most common
abbreviation.
Examples: "foo", "g3", "-1"
end-id The "end-id" type ends in a keyword character, but all the other
characters are not keyword characters.
Examples: "#i", "..f", "$/7"
non-id The "non-id" type ends in a non-keyword character, the other
characters may be of any type, excluding space and tab. {this type
is not supported by Vi}
Examples: "def#", "4/7$"
,,img
不能full-id
像开头那样,
。它不能end-id
因为所有其他字符都必须是非关键字字符。也不可能non-id
。
我建议更改您的缩写。例如img,,
推荐阅读
- angular - 如何测试角度形式的第一个表单控制重点是使用茉莉花的页面加载
- java - 无法使用 Java 从 S3 下载文件
- java - @Test(expected = Exception.class) 或 Assertions.assertThrows(...) 或 assertThatThrownBy(..) 推荐哪一个?
- swift - 在主应用程序包和它包含的框架之间进行通信
- windows - GitHub 的凭据“卡在”我的另一个帐户上
- powershell - 将变量值推送到新的记事本窗口中(不保存文件)
- apache-nifi - 如何在 NiFi 中向管理员用户授予所有权限
- python - 如何从 PdfPages 将 pandas 数据框保存到现有的 pdf 中
- python - 将 numpy 数组列表转换为单个 numpy 数组的最直接方法是什么?
- opalvoip - 如何在 Ubuntu 18 上构建 libOpal