init-evil-rebellion-clone.el 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. ;;; Code:
  2. (evil-set-initial-state 'snake-mode 'emacs)
  3. (evil-set-initial-state 'comint-mode 'normal)
  4. (evil-set-initial-state 'eww-mode 'emacs)
  5. (evil-set-initial-state 'eww-bookmark-mode 'emacs)
  6. (evil-set-initial-state 'eshell-mode 'emacs)
  7. (evil-set-initial-state 'shell-mode 'emacs)
  8. (evil-set-initial-state 'jabber-chat-mode 'emacs)
  9. (evil-set-initial-state 'jabber-roster-mode 'emacs)
  10. (evil-set-initial-state 'gub-mode 'emacs)
  11. (evil-set-initial-state 'git-commit-mode 'emacs)
  12. (evil-set-initial-state 'git-rebase-mode 'emacs)
  13. (evil-set-initial-state 'git-timemachine-mode 'emacs)
  14. (evil-set-initial-state 'term-mode 'emacs)
  15. (evil-set-initial-state 'bubbles-mode 'emacs)
  16. (evil-set-initial-state 'markdown-mode 'normal)
  17. (evil-set-initial-state 'org-mode 'normal)
  18. ;; why is this not working?
  19. (evil-set-initial-state 'info-mode 'emacs)
  20. (evil-set-initial-state 'help-mode 'emacs)
  21. (evil-set-initial-state 'image-mode 'emacs)
  22. (evil-set-initial-state 'helm-grep-mode 'emacs)
  23. (evil-set-initial-state 'grep-mode 'emacs)
  24. (evil-set-initial-state 'bc-menu-mode 'emacs)
  25. (evil-set-initial-state 'rdictcc-buffer-mode 'emacs)
  26. (evil-set-initial-state 'wdired-mode 'normal)
  27. (evil-set-initial-state 'git-timemachine-mode 'emacs)
  28. (evil-set-initial-state 'sx-compose-mode 'emacs)
  29. (evil-set-initial-state 'sx-question-mode 'emacs)
  30. (evil-set-initial-state 'sx-question-list-mode 'emacs)
  31. (evil-set-initial-state 'erc-mode 'emacs)
  32. (evil-set-initial-state 'paradox-menu-mode 'emacs)
  33. (evil-set-initial-state 'woman-mode 'emacs)
  34. (evil-set-initial-state 'pdf-view-mode 'emacs)
  35. ;; this is needed for committing git messages. It's annoying to have to press i every time I want make a git commit
  36. (evil-set-initial-state 'text-mode 'insert)
  37. ;; trying to make all modes that use motion state, you evil-emacs state by default
  38. ;; https://www.reddit.com/r/evilmode/comments/323xh1/is_it_possible_to_use_vi_keybindings_everywhere/
  39. ;; but it seemed to make it pretty hard to make a commit w/ magit
  40. ;; (setq evil-normal-state-modes (append evil-motion-state-modes evil-emacs-state-modes))
  41. ;; (setq evil-motion-state-modes nil)
  42. (evil-set-initial-state 'dired-mode 'emacs)
  43. (with-eval-after-load 'dired
  44. (define-key dired-mode-map (kbd "n") #'dired-next-line)
  45. (define-key dired-mode-map (kbd "p") #'dired-previous-line)
  46. (define-key dired-mode-map (kbd "s") #'forward-char)
  47. ;; "T" is normally bound to dired-do-touch
  48. (define-key dired-mode-map (kbd "T") #'dired-toggle-marks)
  49. (define-key dired-mode-map (kbd "S") #'dired-sort-toggle-or-edit))
  50. (evil-set-initial-state 'magit-branch-manager-mode 'emacs)
  51. ;; h is bound to magit-key-mode-popup-diff-options
  52. ;; H is bound to magit-diff-toggle-refine-hunk
  53. (with-eval-after-load 'magit
  54. (define-key magit-status-mode-map (kbd "h") #'magit-goto-next-section)
  55. (define-key magit-status-mode-map (kbd "t") #'magit-goto-previous-section)
  56. (define-key magit-status-mode-map (kbd "H") #'magit-key-mode-popup-diff-options)
  57. (define-key magit-status-mode-map (kbd "T") #'magit-key-mode-popup-tagging))
  58. ;; this defines the up and down keys for gnus
  59. ;; BUT both need to define T,H to do what N and P do
  60. ;;(define-key gnus-group-mode-map (kbd "t") #'gnus-group-prev-unread-group)
  61. ;;(define-key gnus-group-mode-map (kbd "h") #'gnus-group-next-unread-group)
  62. ;;(define-key gnus-summary-mode-map (kbd "t") #'gnus-summary-prev-unread-article)
  63. ;;(define-key gnus-summary-mode-map (kbd "h") #'gnus-summary-next-unread-article)
  64. ;; I'll have to try out each one at a time and see which one works, if one does work
  65. ;;(evil-set-initial-state 'ggtags-navigation-mode 'normal)
  66. ;;(evil-set-initial-state 'ggtags-tags-mode 'normal)
  67. ;; setting this to emacs makes opening up any new buffer set the evil state to emacs
  68. (evil-define-key 'normal org-mode-map (kbd "RET") 'org-return)
  69. (evil-define-key 'normal org-mode-map (kbd "TAB") 'org-cycle)
  70. (evil-set-initial-state 'ggtags-global-mode 'emacs)
  71. (add-hook 'edebug-setup-hook 'evil-emacs-state)
  72. (provide 'init-evil-rebellion-clone)