如何保存包含“转义"的Vim宏.按键? [英] How to save a Vim macro that contains "Escape" key presses?
本文介绍了如何保存包含“转义"的Vim宏.按键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我经常使用以下Vim宏(它将当前行放在XML标记内):
I use the following Vim macro a lot (it puts the current line inside XML tags):
I<e>^[A</e>
所以我将其保存到我的.vimrc中
So I saved it into my .vimrc
let @e='I<e>^[A</e>'
但是它不起作用.
^[
部分的意思是转义",但在.vimrc
But it does not work.
The ^[
part means "Escape" but it is not understood as such in .vimrc
如何保存此宏或包含转义"的任何宏?
How can I save this macro, or any macro that contains "Escape" ?
推荐答案
尝试在插入模式下使用<Ctrl-v><Esc>
输入转义符.
参见vim中的:help i_CTRL-V
.
Try entering the escape with <Ctrl-v><Esc>
in insert mode.
See :help i_CTRL-V
in vim.
这篇关于如何保存包含“转义"的Vim宏.按键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文