复制:
如果您经常使用线路,则在没有选择任何区域时,您可能需要在线路上进行复制(kill-ring-save)和切割(kill-region)功能:
(defadvice kill-ring-save (before slickcopy activate compile) "When called interactively with no active region,copy a single line instead." (interactive (if mark-active (list (region-beginning) (region-end)) (list (line-beginning-position) (line-beginning-position 2))))) (defadvice kill-region (before slickcut activate compile) "When called interactively with no active region,kill a single line instead." (interactive (if mark-active (list (region-beginning) (region-end)) (list (line-beginning-position) (line-beginning-position 2)))))
然后你可以用M-W复制行。
粘贴:
通常,前缀参数只是执行一次动作多次,所以你会期望C-u 10 C-y工作,但在这种情况下,C-y使用它的参数来表示kill-ring的哪个元素“yank”(粘贴)。我可以想到的唯一的解决方案是kronoz说的:用Cx(Cy Cx)记录一个宏,然后让Cu的参数转到kmacro-end-and-call-macro(这是Cu 9 Cx e甚至只是C -9 Cx e或M-9 Cx e)。
其他方式:你也可以留在M-x蛇蝎模式,并使用yy10p