我想使用一组短键,在我输入后,每个短键都会扩展为一个文本块。
例如,假设两个短键是“:greeting”,“:lalist”,那么
输入“greeting + TAB”(或“:greeting”)应扩展为
Hi, dear user: We are very glad that you have submitted your paper to XXX.
XXX is a world renowned conference in the field of YYY. This year, we have
about BLABLA.
输入“lalist + TAB”(或“:lalist”)应扩展为
\begine{list}
\item
\end{list}
虽然“snipMate”能够扩展一些关键字,例如对于c程序,它无法扩展自定义关键字,如上面的“问候”。
我该怎么做?
谢谢!我不知道snipMate和vim缩写的自定义扩展功能。问题解决了。
答案 0 :(得分:2)
这看起来像缩写的工作。请参阅:help abbr
下的广泛vim帮助。简而言之,请将其放在.vimrc
:
iabbr :greeting Hi, dear user: We are very glad that you have submitted your paper to XXX.<CR>XXX is a world renowned conference in the field of YYY. This year, we have<CR>about BLABLA.
在这种情况下提供 insert 模式的缩写。