<commit_before>
;;; Commentary:

;; My user-init-file, with all my configuration

;;; Code:

;;;
;;; Packages
;;;

(require 'package)
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/") t)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
;; (add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t)
(add-to-list 'package-archives '("marmalde" . "https://marmalade-repo.org/packages/") t)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
(package-initialize)

(if (not (package-installed-p 'use-package))
    (progn (package-refresh-contents)
	   (package-install 'use-package)))
(require 'use-package)

(defun my-add-use-package-to-imenu ()
  (interactive)
  (add-to-list 'imenu-generic-expression
	       (list "Packages Used" "\\s-*(use-package\\s-+\\(\\(\\sw\\|\\s_\\)+\\)" 1)))
(add-hook 'emacs-lisp-mode-hook #'my-add-use-package-to-imenu)

;;;
;;; Looks
;;;

(if (fboundp 'scroll-bar-mode) (scroll-bar-mode 0))
(if (fboundp 'horizontal-scroll-bar-mode) (horizontal-scroll-bar-mode 0))
(if (fboundp 'tool-bar-mode) (tool-bar-mode 0))
(if (fboundp 'menu-bar-mode) (menu-bar-mode 0))
(if (fboundp 'tooltip-mode) (tooltip-mode 0))
(setq
 inhibit-splash-screen t
 tooltip-use-echo-area t)

(use-package solarized-theme
  :ensure
  :init
  (load-theme 'solarized-dark t))

;; battery status
(use-package fancy-battery
  :ensure
  :config (fancy-battery-mode))

(set-frame-font "Source Code Pro-10.5" t)

(use-package diminish
  :ensure)

;;;
;;; Keybindings
;;;

;; evil - vi compatible keybindings
(use-package evil
  :ensure
  :config
  (progn
    (evil-set-initial-state 'project-explorer-mode 'emacs)
    (defadvice ansi-term (after turn-off-evil-in-ansi-term ())
      "Disable whatever the fuck evil mode does in ansi-term"
      (turn-off-evil-mode))
    (ad-activate 'ansi-term)
    (evil-mode 1)))

(use-package guide-key
  :ensure
  :diminish guide-key-mode
  :config
  (setq guide-key/guide-key-sequence '("C-c" "C-x" "M-s"))
  (setq guide-key/recursive-key-sequence-flag t)
  (guide-key-mode 1))

;;;
;;; Basic Configuration
;;;

(setq-default
 indent-tabs-mode nil ; tabs are evil
 c-basic-offset 4)

(setq
 truncate-lines t ; line wrapping? wtf?
 comment-empty-lines t ; comment empty lines too
 abbrev-file-name "~/.emacs.d/abbref_defs" ; save abbreviations here
 c-default-style "k&r"
 tab-width 4)

;; single space after period ends sentence
(setq sentence-end-double-space nil)

;; show matching parenthesis
(show-paren-mode 1)

;; show column numbers too
(column-number-mode 1)

;; backups
(setq backup-directory-alist '((".*" . "~/.saves"))
      backup-by-copying t)

;; replace selection when typing
(pending-delete-mode)

;; paste (aka yank) at point, not where mouse is clicked
(setq mouse-yank-at-point t)

;; I can't understand why editing a version-controlled file (through a
;; symlink) might be dangerous. Maybe I need to use RCS.
(setq vc-follow-symlinks t)

;;;
;;; Navigation
;;;

(use-package recentf
  :ensure)

(use-package ido
  :ensure
  :init
  (progn
    (setq ido-everywhere t)
    (setq ido-enable-flex-matching t)
    (ido-mode 1)))

(use-package ido-vertical-mode
  :ensure
  :init
  (ido-vertical-mode))

(use-package ido-ubiquitous
  :ensure
  :init
  (ido-ubiquitous-mode))

(use-package flx-ido
  :ensure
  :init
  (flx-ido-mode 1))

(use-package imenu
  :ensure
  :config
  (setq imenu-max-item-length "Unlimited"))

(use-package idomenu
  :ensure
  :bind
  ("C-c i" . idomenu))

(use-package smex
  :ensure
  :config
  (setq smex-key-advice-ignore-menu-bar t)
  :bind
  ("M-x" . smex)
  :init
  (smex-initialize))

;;;
;;; Projects
;;;

(use-package projectile
  :ensure
  :init
  ; "P[project name]" to indicate a project or empty string
  (setq projectile-mode-line '(:eval
                               (let ((mode-line (condition-case nil
                                                    (format " P[%s]"
                                                            (file-name-nondirectory (directory-file-name (projectile-project-root))))
                                                  (error ""))))
                                 mode-line)))
  :config
  (projectile-global-mode))

(use-package ack-and-a-half
  :ensure)

(use-package project-explorer
  :ensure
  :bind ("<f11>" . project-explorer-open))

(use-package magit
  :ensure
  :bind ("<f12>" . magit-status)
  :commands magit-status)

(use-package git-gutter
  :ensure
  :diminish ""
  :init
  (global-git-gutter-mode))


(use-package monky
  :ensure)

;;;
;;; Buffers
;;;<commit_msg>emacs: reindent a really long config line<commit_after>
;;; Commentary:

;; My user-init-file, with all my configuration

;;; Code:

;;;
;;; Packages
;;;

(require 'package)
(add-to-list 'package-archives '("gnu" . "https://elpa.gnu.org/packages/") t)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/") t)
;; (add-to-list 'package-archives '("melpa-stable" . "http://stable.melpa.org/packages/") t)
(add-to-list 'package-archives '("marmalde" . "https://marmalade-repo.org/packages/") t)
(add-to-list 'package-archives '("org" . "http://orgmode.org/elpa/") t)
(package-initialize)

(if (not (package-installed-p 'use-package))
    (progn (package-refresh-contents)
	   (package-install 'use-package)))
(require 'use-package)

(defun my-add-use-package-to-imenu ()
  (interactive)
  (add-to-list 'imenu-generic-expression
	       (list "Packages Used" "\\s-*(use-package\\s-+\\(\\(\\sw\\|\\s_\\)+\\)" 1)))
(add-hook 'emacs-lisp-mode-hook #'my-add-use-package-to-imenu)

;;;
;;; Looks
;;;

(if (fboundp 'scroll-bar-mode) (scroll-bar-mode 0))
(if (fboundp 'horizontal-scroll-bar-mode) (horizontal-scroll-bar-mode 0))
(if (fboundp 'tool-bar-mode) (tool-bar-mode 0))
(if (fboundp 'menu-bar-mode) (menu-bar-mode 0))
(if (fboundp 'tooltip-mode) (tooltip-mode 0))
(setq
 inhibit-splash-screen t
 tooltip-use-echo-area t)

(use-package solarized-theme
  :ensure
  :init
  (load-theme 'solarized-dark t))

;; battery status
(use-package fancy-battery
  :ensure
  :config (fancy-battery-mode))

(set-frame-font "Source Code Pro-10.5" t)

(use-package diminish
  :ensure)

;;;
;;; Keybindings
;;;

;; evil - vi compatible keybindings
(use-package evil
  :ensure
  :config
  (progn
    (evil-set-initial-state 'project-explorer-mode 'emacs)
    (defadvice ansi-term (after turn-off-evil-in-ansi-term ())
      "Disable whatever the fuck evil mode does in ansi-term"
      (turn-off-evil-mode))
    (ad-activate 'ansi-term)
    (evil-mode 1)))

(use-package guide-key
  :ensure
  :diminish guide-key-mode
  :config
  (setq guide-key/guide-key-sequence '("C-c" "C-x" "M-s"))
  (setq guide-key/recursive-key-sequence-flag t)
  (guide-key-mode 1))

;;;
;;; Basic Configuration
;;;

(setq-default
 indent-tabs-mode nil ; tabs are evil
 c-basic-offset 4)

(setq
 truncate-lines t ; line wrapping? wtf?
 comment-empty-lines t ; comment empty lines too
 abbrev-file-name "~/.emacs.d/abbref_defs" ; save abbreviations here
 c-default-style "k&r"
 tab-width 4)

;; single space after period ends sentence
(setq sentence-end-double-space nil)

;; show matching parenthesis
(show-paren-mode 1)

;; show column numbers too
(column-number-mode 1)

;; backups
(setq backup-directory-alist '((".*" . "~/.saves"))
      backup-by-copying t)

;; replace selection when typing
(pending-delete-mode)

;; paste (aka yank) at point, not where mouse is clicked
(setq mouse-yank-at-point t)

;; I can't understand why editing a version-controlled file (through a
;; symlink) might be dangerous. Maybe I need to use RCS.
(setq vc-follow-symlinks t)

;;;
;;; Navigation
;;;

(use-package recentf
  :ensure)

(use-package ido
  :ensure
  :init
  (progn
    (setq ido-everywhere t)
    (setq ido-enable-flex-matching t)
    (ido-mode 1)))

(use-package ido-vertical-mode
  :ensure
  :init
  (ido-vertical-mode))

(use-package ido-ubiquitous
  :ensure
  :init
  (ido-ubiquitous-mode))

(use-package flx-ido
  :ensure
  :init
  (flx-ido-mode 1))

(use-package imenu
  :ensure
  :config
  (setq imenu-max-item-length "Unlimited"))

(use-package idomenu
  :ensure
  :bind
  ("C-c i" . idomenu))

(use-package smex
  :ensure
  :config
  (setq smex-key-advice-ignore-menu-bar t)
  :bind
  ("M-x" . smex)
  :init
  (smex-initialize))

;;;
;;; Projects
;;;

(use-package projectile
  :ensure
  :init
  ;; "P[project name]" to indicate a project or empty string
  (setq projectile-mode-line
        '(:eval
          (let ((mode-line
                 (condition-case nil
                     (format " P[%s]"
                             (file-name-nondirectory
                              (directory-file-name (projectile-project-root))))
                   (error ""))))
            mode-line)))
  :config
  (projectile-global-mode))

(use-package ack-and-a-half
  :ensure)

(use-package project-explorer
  :ensure
  :bind ("<f11>" . project-explorer-open))

(use-package magit
  :ensure
  :bind ("<f12>" . magit-status)
  :commands magit-status)

(use-package git-gutter
  :ensure
  :diminish ""
  :init
  (global-git-gutter-mode))


(use-package monky
  :ensure)

;;;
;;; Buffers
;;;
{'fraction_non_alphanumeric': 0.17071841273302082, 'fraction_numerical': 0.004578654747628911, 'mean_word_length': 3.02192021043402, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 7, 'profanity_word_list.json': 2, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '569423', 'n_tokens_mistral': 3534, 'n_tokens_neox': 3433, 'n_words': 756}