<commit_before>;;; my-bindings.el

(eval-when-compile (require 'core-defuns))

(defmacro @find-file-in (path &optional project-p)
  "Returns a interactive function for searching files"
  `(lambda () (interactive)
     (let ((default-directory ,path))
       (,@(if project-p
              '(counsel-projectile-find-file)
            '(call-interactively 'counsel-find-file)
            )))))

(map! [f9]   'what-face
      ;; Essential
      (:when (featurep 'helm)
        "M-x"  'helm-M-x
        "A-x"  'helm-M-x
        "M-X"  'helm-apropos
        "A-X"  'helm-apropos
        "M-o"  'helm-find-files)
      (:when (featurep 'ivy)
        "M-x"  'smex
        "A-x"  'smex
        "M-X"  'smex-major-mode-commands
        "A-X"  'smex-major-mode-commands
        "M-o"  'counsel-find-file)
      "M-;"  'eval-expression
      "A-;"  'eval-expression
      ;; Tools
      "M-/"  'evil-commentary-line
      "A-/"  'evil-commentary-line
      "M-b"  'doom:build
      "C-`"  'doom/popup-last-buffer
      "M-~"  'doom/eshell
      ;; Text-scaling
      "M-0"  (λ! (text-scale-set 0))
      "M-="  'text-scale-increase
      "M--"  'text-scale-decrease
      ;; Simple window navigation/manipulation
      "M-t"  'doom:tab-create
      "M-T"  'doom/tab-display
      "M-w"  'doom/close-window-or-tab
      "M-W"  'delete-frame
      "M-n"  'doom/new-buffer
      "M-N"  'doom/new-frame
      "C-j"  'evil-window-down
      "C-k"  'evil-window-up
      "C-h"  'evil-window-left
      "C-l"  'evil-window-right
      "A-C-j" 'doom/evil-window-resize-d
      "A-C-k" 'doom/evil-window-resize-u
      "A-C-h" 'doom/evil-window-resize-l
      "A-C-l" 'doom/evil-window-resize-r
      ;; Temporary escape into emacs mode
      "<C-escape>" 'evil-emacs-state
      :e "<C-escape>" 'evil-normal-state
      ;; Switching tabs (workgroups)
      :m "M-1"  (λ! (doom:switch-to-tab 0))
      :m "M-2"  (λ! (doom:switch-to-tab 1))
      :m "M-3"  (λ! (doom:switch-to-tab 2))
      :m "M-4"  (λ! (doom:switch-to-tab 3))
      :m "M-5"  (λ! (doom:switch-to-tab 4))
      :m "M-6"  (λ! (doom:switch-to-tab 5))
      :m "M-7"  (λ! (doom:switch-to-tab 6))
      :m "M-8"  (λ! (doom:switch-to-tab 7))
      :m "M-9"  (λ! (doom:switch-to-tab 8))

      "<M-backspace>"     'doom/backward-kill-to-bol-and-indent
      "<A-left>"          'backward-word
      "<A-right>"         'forward-word
      "A-SPC"             'just-one-space
      "M-a"               'mark-whole-buffer
      "M-c"               'evil-yank
      "M-q"               'save-buffers-kill-emacs
      "M-s"               'save-buffer
      "M-v"               'clipboard-yank
      "M-z"               'undo
      "M-Z"               'redo
      "C-M-f"             'doom/toggle-fullscreen
      :m  "M-j"           'doom/multi-next-line
      :m  "M-k"           'doom/multi-previous-line
      :n  "M-r"           'doom:eval-buffer
      :v  "M-r"           'doom:eval-region
      :ni "<M-f1>"        'doom:docs-lookup
      ;; Textmate-esque indent shift left/right
      :i  "M-]"           'doom/smart-indent
      :i  "M-["           'doom/dumb-dedent
      ;; Restore osx text objects
      :i  "<A-backspace>" 'evil-delete-backward-word
      :i  "<A-delete>"    'doom/delete-forward-word

      ;;; <leader> and <localleader>
      :m ";" 'evil-ex
      (:leader
        :nv ","   'doom/ivy-switch-project-buffer
        :nv "<"   'doom/ivy-switch-buffer
        ;; :nv ","   'helm-buffers-list
        ;; :nv "<"   'helm-mini
        :nv "."   (@find-file-in default-directory)
        :nv "/"   (@find-file-in (doom/project-root) t)
        :nv ">"   'projectile-find-file-in-known-projects
        :n  ":"   'imenu-list-minor-mode
        ;; :nv ";"   'helm-semantic-or-imenu
        :nv ";"   'counsel-imenu
        :v  "="   'align-regexp
        :nv "a"   'projectile-find-other-file
        ;; :n  "b"   'helm-bookmarks
        :n  "b"   'counsel-bookmark
        :n  "e"   'doom/flycheck-errors
        :n  "k"   'doom:docs-lookup
        :nv "l"   'doom/nlinum-toggle
        ;; :nv "m"   'helm-recentf
        :nv "m"   'counsel-recentf
        :nv "M"   'projectile-recentf
        ;; :nv "p"   'helm-projectile-switch-project
        :nv "p"   'counsel-yank-pop
        :nv "P"   'counsel-projectile-switch-project
        :n  "R"   'doom/reset-theme
        :n  "s"   'yas-visit-snippet-file
        :n  "S"   'doom/yas-find-file
        ;; Quick quitting
        :nv "Q"   'evil-save-and-quit
        :nv "C-q" 'doom/kill-workgroup-and-quit
        ;; Quick access to config files
        :nv "E"   (@find-file-in doom-emacs-dir t)
        :nv "\\"  (@find-file-in (f-expand ".dotfiles" "~") t)
        ;; Alternative to C-h (used as window shortcut)
        :n  "h"   'help-command
        (:prefix "d" ; <diff>
          :n "." 'doom/vcs-show-hunk
          :n "/" 'vc-diff
          :n "d" 'magit-status
          :n "D" 'git-messenger:popup-message
          :n "s" 'doom/vcs-stage-hunk<commit_msg>Polish my-bindings.el<commit_after>;;; my-bindings.el

(eval-when-compile (require 'core-defuns))

(defmacro @find-file-in (path &optional project-p)
  "Returns a interactive function for searching files"
  `(lambda () (interactive)
     (let ((default-directory ,path))
       (,@(if project-p
              '(counsel-projectile-find-file)
            '(call-interactively 'counsel-find-file)
            )))))

(map! [f9]   'what-face
      ;; Essential
      "M-x"  'smex
      "A-x"  'smex
      "M-X"  'smex-major-mode-commands
      "A-X"  'smex-major-mode-commands
      "M-;"  'eval-expression
      "A-;"  'eval-expression
      ;; Tools
      "M-/"  'evil-commentary-line
      "A-/"  'evil-commentary-line
      "M-b"  'doom:build
      "C-`"  'doom/popup-last-buffer
      "M-~"  'doom/eshell
      ;; Text-scaling
      "M-0"  (λ! (text-scale-set 0))
      "M-="  'text-scale-increase
      "M--"  'text-scale-decrease
      ;; Simple window navigation/manipulation
      "M-t"  'doom:tab-create
      "M-T"  'doom/tab-display
      "M-w"  'doom/close-window-or-tab
      "M-W"  'delete-frame
      "M-n"  'doom/new-buffer
      "M-N"  'doom/new-frame
      "C-j"  'evil-window-down
      "C-k"  'evil-window-up
      "C-h"  'evil-window-left
      "C-l"  'evil-window-right
      "A-C-j" 'doom/evil-window-resize-d
      "A-C-k" 'doom/evil-window-resize-u
      "A-C-h" 'doom/evil-window-resize-l
      "A-C-l" 'doom/evil-window-resize-r
      ;; Temporary escape into emacs mode
      [C-escape]    'evil-emacs-state
      :e [C-escape] 'evil-normal-state
      ;; Switching tabs (workgroups)
      :m "M-1"  (λ! (doom:switch-to-tab 0))
      :m "M-2"  (λ! (doom:switch-to-tab 1))
      :m "M-3"  (λ! (doom:switch-to-tab 2))
      :m "M-4"  (λ! (doom:switch-to-tab 3))
      :m "M-5"  (λ! (doom:switch-to-tab 4))
      :m "M-6"  (λ! (doom:switch-to-tab 5))
      :m "M-7"  (λ! (doom:switch-to-tab 6))
      :m "M-8"  (λ! (doom:switch-to-tab 7))
      :m "M-9"  (λ! (doom:switch-to-tab 8))

      [M-backspace]       'doom/backward-kill-to-bol-and-indent
      [A-left]            'backward-word
      [A-right]           'forward-word
      "A-SPC"             'just-one-space
      "M-a"               'mark-whole-buffer
      "M-c"               'evil-yank
      "M-q"               'save-buffers-kill-emacs
      "M-s"               'save-buffer
      "M-v"               'clipboard-yank
      "M-z"               'undo
      "M-Z"               'redo
      "C-M-f"             'doom/toggle-fullscreen
      :m  "A-j"           'doom/multi-next-line
      :m  "A-k"           'doom/multi-previous-line
      :n  "M-r"           'doom:eval-buffer
      :v  "M-r"           'doom:eval-region
      :ni [M-f1]          'doom:docs-lookup
      ;; Textmate-esque indent shift left/right
      :i  "M-]"           'doom/smart-indent
      :i  "M-["           'doom/dumb-dedent
      ;; Restore osx text objects
      :i  [A-backspace]   'evil-delete-backward-word
      :i  [A-delete]      'doom/delete-forward-word

      ;;; <leader> and <localleader>
      :m ";" 'evil-ex
      (:leader
        :nv ","   'doom/ivy-switch-project-buffer ; or 'helm-buffers-list
        :nv "<"   'doom/ivy-switch-buffer         ; or 'helm-mini
        :nv "."   (@find-file-in default-directory)
        :nv "/"   (@find-file-in (doom/project-root) t)
        :nv ">"   'projectile-find-file-in-known-projects
        :n  ":"   'imenu-list-minor-mode          ; or 'helm-semantic-or-imenu
        :nv ";"   'counsel-imenu
        :v  "="   'align-regexp
        :nv "a"   'projectile-find-other-file
        :n  "b"   'counsel-bookmark               ; or 'helm-bookmarks
        :n  "B"   'bookmark-delete
        :n  "e"   'doom/flycheck-errors
        :n  "k"   'doom:docs-lookup
        :nv "l"   'doom/nlinum-toggle
        :nv "m"   'counsel-recentf                ; or 'helm-recentf
        :nv "M"   'projectile-recentf
        :nv "p"   'counsel-yank-pop
        :nv "P"   'counsel-projectile-switch-project ; or 'helm-projectile-switch-project
        :n  "R"   'doom/reset-theme
        :n  "s"   'yas-visit-snippet-file
        :n  "S"   'doom/yas-find-file
        ;; Quick quitting
        :nv "Q"   'evil-save-and-quit
        :nv "C-q" 'doom/kill-workgroup-and-quit
        ;; Quick access to config files
        :nv "E"   (@find-file-in doom-emacs-dir t)
        :nv "\\"  (@find-file-in (f-expand ".dotfiles" "~") t)
        ;; Alternative to C-h (used as window shortcut)
        :n  "h"   'help-command
        (:prefix "d" ; <diff>
          :n "." 'doom/vcs-show-hunk
          :n "/" 'vc-diff
          :n "d" 'magit-status
          :n "D" 'git-messenger:popup-message
          :n "s" 'doom/vcs-stage-hunk
{'fraction_non_alphanumeric': 0.178185188999897, 'fraction_numerical': 0.0045318776393037385, 'mean_word_length': 1.590024006401707, 'pattern_counts': {'":': 2, '<': 20, '<?xml version=': 0, '>': 19, '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': '4516486', 'n_tokens_mistral': 4017, 'n_tokens_neox': 3791, 'n_words': 690}