使用Evil-mode为Haskell开发设置Emacs

时间:2016-10-24 20:17:47

标签: emacs evil-mode haskell-mode

我最近使用邪恶模式从vim切换到emacs,而使用clojure进行编码很愉快,我发现haskell环境无法很好地应对邪恶模式......特别是“o”,“O”和“RET”(在插入模式下)命令在打开新行时会中断当前缩进。例如:

say :: String |

按“o”..

say :: String
       |

这很烦人,但我在另一个答案中找到了这个解决方案:

    (defun evil-open-below (count)
    "Insert a new line below point and switch to Insert state.
    The insertion will be repeated COUNT times."
    (interactive "p")
    (evil-insert-newline-below)
    (setq evil-insert-count count
            evil-insert-lines t
            evil-insert-vcount nil)
    (evil-insert-state 1)
    (add-hook 'post-command-hook #'evil-maybe-remove-spaces)
    )

也就是说,覆盖每个键,但由于某种原因,“O”等效不起作用:

    (defun evil-open-above (count)
    "Insert a new line above point and switch to Insert state.
    The insertion will be repeated COUNT times."
    (interactive "p")
    (evil-insert-newline-above)
    (setq evil-insert-count count
            evil-insert-lines t
            evil-insert-vcount nil)
    (evil-insert-state 1)
    (add-hook 'post-command-hook #'evil-maybe-remove-spaces)
    )

另外,如何对RET键执行相同的操作?

0 个答案:

没有答案
相关问题