本文介绍了Emacs重复字符串n次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在学习在Emacs中导航/编辑的基础知识,我很好奇如何完成以下任务:
I'm learning the basics of navigating/editing in Emacs and I'm curious how one could accomplish the following task:
- 在正常的文本编辑模式下重复字符串'bla'n次。
假设我想重复它五次以生成'bla bla bla bla bla'。我尝试...
Let's say I want to repeat it five times to generate 'bla bla bla bla bla '. I tried...
C-u 5 bla...但命令在输入'b'后执行,而且我只获取'bbbbb'。
...but the command executes after the 'b' is entered, and I only get 'bbbbb'.
'
推荐答案一种方法是通过键盘宏:
Cx ( bla Cx ) Cu 4 Cx e
C-x (bla C-x)C-u4C-xe
您也可以在宏终止之前插入重复计数:
You can also just insert the repeat count before the macro termination:
Cx ( bla Cu 5 Cx )
C-x (bla C-u5C-x)
更多推荐
Emacs重复字符串n次
发布评论