<commit_before>;;; evil-custom.el --- Sets up Evil

;;; Commentary:

;; Loads up Evil, activates it, and configures it with custom leading
;; bindings, and more.

;;; Code:
(require 'use-package)

(use-package evil
  :init
  (progn
    (setq
     evil-insert-state-message nil
     evil-visual-state-message nil)

    (define-key evil-normal-state-map "Y" (kbd "y$"))
    (define-key evil-normal-state-map (kbd "SPC") 'evil-repeat-find-char)
    (define-key
      evil-normal-state-map (kbd "S-SPC") 'evil-repeat-find-char-reverse)

    (define-key evil-normal-state-map ";" 'evil-ex)
    (define-key evil-visual-state-map ";" 'evil-ex)

    (defadvice evil-search-next
      (after advice-for-evil-search-next activate)
      (evil-scroll-line-to-center (line-number-at-pos)))

    (defadvice evil-search-previous
      (after advice-for-evil-search-previous activate)
      (evil-scroll-line-to-center (line-number-at-pos)))

    ;; Setup initial Evil mode for a number of commonly used modes.
    (loop for (mode . state)
          in '((ielm-mode . insert)
               (nrepl-mode . insert)
               (shell-mode . insert)
               (git-rebase-mode . emacs)
               (term-mode . emacs)
               (help-mode . emacs)
               (helm-grep-mode . emacs)
               (grep-mode . emacs)
               (bc-menu-mode . emacs)
               (magit-branch-manager-mode . emacs)
               (rdictcc-buffer-mode . emacs)
               (dired-mode . normal)
               (wdired-mode . normal))
          do (evil-set-initial-state mode state))

    ;; Use escape to quit, and not as a meta-key.
    (define-key evil-normal-state-map [escape] 'keyboard-quit)
    (define-key evil-visual-state-map [escape] 'keyboard-quit)
    (define-key minibuffer-local-map [escape] 'minibuffer-keyboard-quit)
    (define-key minibuffer-local-ns-map [escape] 'minibuffer-keyboard-quit)
    (define-key minibuffer-local-completion-map [escape] 'minibuffer-keyboard-quit)
    (define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit)
    (define-key minibuffer-local-isearch-map [escape] 'minibuffer-keyboard-quit)

    (use-package evil-leader
      :init (global-evil-leader-mode)
      :config
      (progn
        (evil-leader/set-leader ",")

        (evil-leader/set-key
          "db" 'kill-buffer
          "dw" 'delete-window
          "eb" 'eval-buffer
          "ee" 'eval-expression
          "er" 'eval-region
          "fb" 'ido-switch-buffer
          "fd" 'ido-dired
          "ff" 'ido-find-file
          "fp" 'fiplr-find-file
          "gb" 'magit-blame-mode
          "gl" 'magit-log
          "gs" 'magit-status
          "pb" 'projectile-switch-to-buffer
          "pd" 'projectile-dired
          "pf" 'projectile-find-file)

        (evil-leader/set-key-for-mode 'org-mode
          "t" 'org-todo
          "s" 'org-sort-list)

        (evil-leader/set-key-for-mode 'clojure-mode
          "a" 'clojure-jump-between-tests-and-code
          "cc" 'cider
          "cj" 'cider-jack-in
          "cq" 'cider-quit
          "rs" 'cljr-sort-ns
          "rr" 'cljr-add-require-to-ns
          "ru" 'cljr-add-use-to-ns)

        (evil-leader/set-key-for-mode 'ruby-mode
          "a" 'rspec-toggle-spec-and-target
          "v" 'rspec-verify
          "V" 'rspec-verify-all)

        (evil-leader/set-key-for-mode 'feature-mode
          "v" 'feature-verify-scenario-at-pos
          "V" 'feature-verify-all-scenarios-in-buffer)))

    (use-package surround
      :init (global-surround-mode 1))

    (use-package evil-matchit
      :init (global-evil-matchit-mode 1))

    (use-package key-chord
      :init (key-chord-mode 1)<commit_msg>Add useful leaders<commit_after>;;; evil-custom.el --- Sets up Evil

;;; Commentary:

;; Loads up Evil, activates it, and configures it with custom leading
;; bindings, and more.

;;; Code:
(require 'use-package)

(use-package evil
  :init
  (progn
    (setq
     evil-insert-state-message nil
     evil-visual-state-message nil)

    (define-key evil-normal-state-map "Y" (kbd "y$"))
    (define-key evil-normal-state-map (kbd "SPC") 'evil-repeat-find-char)
    (define-key
      evil-normal-state-map (kbd "S-SPC") 'evil-repeat-find-char-reverse)

    (define-key evil-normal-state-map ";" 'evil-ex)
    (define-key evil-visual-state-map ";" 'evil-ex)

    (defadvice evil-search-next
      (after advice-for-evil-search-next activate)
      (evil-scroll-line-to-center (line-number-at-pos)))

    (defadvice evil-search-previous
      (after advice-for-evil-search-previous activate)
      (evil-scroll-line-to-center (line-number-at-pos)))

    ;; Setup initial Evil mode for a number of commonly used modes.
    (loop for (mode . state)
          in '((ielm-mode . insert)
               (nrepl-mode . insert)
               (shell-mode . insert)
               (git-rebase-mode . emacs)
               (term-mode . emacs)
               (help-mode . emacs)
               (helm-grep-mode . emacs)
               (grep-mode . emacs)
               (bc-menu-mode . emacs)
               (magit-branch-manager-mode . emacs)
               (rdictcc-buffer-mode . emacs)
               (dired-mode . normal)
               (wdired-mode . normal))
          do (evil-set-initial-state mode state))

    ;; Use escape to quit, and not as a meta-key.
    (define-key evil-normal-state-map [escape] 'keyboard-quit)
    (define-key evil-visual-state-map [escape] 'keyboard-quit)
    (define-key minibuffer-local-map [escape] 'minibuffer-keyboard-quit)
    (define-key minibuffer-local-ns-map [escape] 'minibuffer-keyboard-quit)
    (define-key minibuffer-local-completion-map [escape] 'minibuffer-keyboard-quit)
    (define-key minibuffer-local-must-match-map [escape] 'minibuffer-keyboard-quit)
    (define-key minibuffer-local-isearch-map [escape] 'minibuffer-keyboard-quit)

    (use-package evil-leader
      :init (global-evil-leader-mode)
      :config
      (progn
        (evil-leader/set-leader ",")

        (evil-leader/set-key
          "a"  'ido-find-alternate-file
          "b"  'ibuffer
          "db" 'kill-buffer
          "dw" 'delete-window
          "eb" 'eval-buffer
          "ee" 'eval-expression
          "er" 'eval-region
          "fb" 'ido-switch-buffer
          "fd" 'ido-dired
          "ff" 'ido-find-file
          "fp" 'fiplr-find-file
          "gb" 'magit-blame-mode
          "gl" 'magit-log
          "gs" 'magit-status
          "pb" 'projectile-switch-to-buffer
          "pd" 'projectile-dired
          "pf" 'projectile-find-file
          "x"  'smex-initialize)

        (evil-leader/set-key-for-mode 'org-mode
          "t" 'org-todo
          "s" 'org-sort-list)

        (evil-leader/set-key-for-mode 'clojure-mode
          "a" 'clojure-jump-between-tests-and-code
          "cc" 'cider
          "cj" 'cider-jack-in
          "cq" 'cider-quit
          "rs" 'cljr-sort-ns
          "rr" 'cljr-add-require-to-ns
          "ru" 'cljr-add-use-to-ns)

        (evil-leader/set-key-for-mode 'ruby-mode
          "a" 'rspec-toggle-spec-and-target
          "v" 'rspec-verify
          "V" 'rspec-verify-all)

        (evil-leader/set-key-for-mode 'feature-mode
          "v" 'feature-verify-scenario-at-pos
          "V" 'feature-verify-all-scenarios-in-buffer)))

    (use-package surround
      :init (global-surround-mode 1))

    (use-package evil-matchit
      :init (global-evil-matchit-mode 1))

    (use-package key-chord
      :init (key-chord-mode 1)
{'fraction_non_alphanumeric': 0.1452581032412965, 'fraction_numerical': 0.0008003201280512205, 'mean_word_length': 1.9636363636363636, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '507242', 'n_tokens_mistral': 2704, 'n_tokens_neox': 2574, 'n_words': 485}