Emacs 复制和粘贴行的有效方法
要复制和粘贴一行,我使用以下方法Emacs 复制和粘贴行的有效方法,emacs,Emacs,要复制和粘贴一行,我使用以下方法 C-a - beginning of line #save the line to kill-ring using kill-line(this is faster than marking, # move to end of line and C-w) C-k - kill-line C-/ - undo kill-line # move point to required line C-p or C-n or C-s (search for the n
C-a - beginning of line
#save the line to kill-ring using kill-line(this is faster than marking,
# move to end of line and C-w)
C-k - kill-line
C-/ - undo kill-line
# move point to required line
C-p or C-n or C-s (search for the nearest line where the paste must be done)
C-y # paste the line
还有比这更有效的方法吗。在vim中,只需键入yy,导航并p执行任务使用
杀死整条线
而不是C-aC-k。默认情况下,它映射到C-s-backspace。对于邪恶模式,只需使用默认的vim键绑定
否则,M-w
(压井环保存)保存该区域。如果要在未选择任何区域的情况下复制当前行:
(put 'kill-ring-save 'interactive-form
'(interactive
(if (use-region-p)
(list (region-beginning) (region-end))
(list (line-beginning-position) (line-beginning-position 2)))))
(put 'kill-region 'interactive-form
'(interactive
(if (use-region-p)
(list (region-beginning) (region-end))
(list (line-beginning-position) (line-beginning-position 2)))))
这更像是一个超级用户问题。对于邪恶模式,只需使用默认的vim键绑定@ceejayoz我想说这更像是一个emacs.stackexchange问题根据emacs-Q,
kill整行
默认绑定到C-s-backspace
@MrBones:谢谢确认。