Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. (defun org-evil-open-below (count)
  2. "Insert a new line below point and switch to Insert state.
  3. The insertion will be repeated COUNT times."
  4. (interactive "p")
  5. (evil-insert-newline-below)
  6. (setq evil-insert-count count
  7. evil-insert-lines t
  8. evil-insert-vcount nil)
  9. (evil-insert-state 1)
  10. (add-hook 'post-command-hook #'evil-maybe-remove-spaces))
  11. (defun org-evil-open-above (count)
  12. "Insert a new line above point and switch to Insert state.
  13. The insertion will be repeated COUNT times."
  14. (interactive "p")
  15. (evil-insert-newline-above)
  16. (setq evil-insert-count count
  17. evil-insert-lines t
  18. evil-insert-vcount nil)
  19. (evil-insert-state 1)
  20. (add-hook 'post-command-hook #'evil-maybe-remove-spaces))
  21. (evil-define-key 'normal org-mode-map (kbd "o") 'org-evil-open-below)
  22. (evil-define-key 'normal org-mode-map (kbd "O") 'org-evil-open-above)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement