当我意识到我需要(编辑)上一行的变量定义(或类似的东西)时,我经常发现自己在一行上打字。我想要的是
我已经设法做到了#1,但是我的 emacs-fu 不够强大,无法完成其余的工作。
最佳答案
这是我简陋的解决方案:
(defun my-insert-before-line ()
(interactive)
(save-excursion
(beginning-of-line)
; I've changed the order of (yank) and (indent-according-to-mode)
; in order to handle the case when yanked line comes with its own indent
(yank)(indent-according-to-mode)
; could be as well changed to simple (newline) it's metter of taste
; and of usage
(newline-and-indent)))
希望它有帮助。
关于Emacs 命令在光标上方插入和缩进行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/622440/