<commit_before>;; init-package.el
;;
;; This file is used for initializing package specific settings.

(defun settings/packages-installed-p ()
  (require 'cl)
  (loop for pkg in settings/packages
        when (not (package-installed-p pkg)) do (return nil)
        finally (return t)))

(defvar settings/packages
  '(evil
    fiplr
    haskell-mode
    helm
    magit
    monokai-theme
    rainbow-delimiters
    smart-mode-line
    switch-window
    undo-tree
    windmove
    window-numbering
    yasnippet))

(with-library package
  ;(add-to-list 'package-archives '("melpa"     . "http://melpa.org/packages/")  t)
  ;(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/") t)
  (package-initialize)
  (unless (settings/packages-installed-p)
    (message "%s" "Refreshing package database...")
    (package-refresh-contents)
    (dolist (pkg settings/packages)
      (when (not (package-installed-p pkg))
        (package-install pkg)))))


;; evil
;; - vi emulation mode
(with-library evil
  (loop for (mode . state) in '((git-commit-mode . insert)
                                (git-rebase-mode . emacs)
                                (term-mode . emacs))
        do (evil-set-initial-state mode state))
  (define-key evil-motion-state-map (kbd "RET" ) nil)
  (evil-mode 1))

;; fiplr
;; - fuzzy file search within version control
(with-library fiplr
  (global-set-key (kbd "C-x f") 'fiplr-find-file))

(with-library helm-config
  (setq helm-split-window-in-side-p t)
  (setq helm-ff-file-name-history-use-recentf t)
  (setq helm-M-x-fuzzy-match t)
  (setq helm-buffers-fuzzy-matching t)
  (global-set-key (kbd "M-x")     'helm-M-x)
  (global-set-key (kbd "C-x C-f") 'helm-find-files)<commit_msg>emacs: add evil surround<commit_after>;; init-package.el
;;
;; This file is used for initializing package specific settings.

(defun settings/packages-installed-p ()
  (require 'cl)
  (loop for pkg in settings/packages
        when (not (package-installed-p pkg)) do (return nil)
        finally (return t)))

(defvar settings/packages
  '(evil
    evil-surround
    fiplr
    haskell-mode
    helm
    magit
    monokai-theme
    rainbow-delimiters
    smart-mode-line
    switch-window
    undo-tree
    windmove
    window-numbering
    yasnippet))

(with-library package
  ;(add-to-list 'package-archives '("melpa"     . "http://melpa.org/packages/")  t)
  ;(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/") t)
  (package-initialize)
  (unless (settings/packages-installed-p)
    (message "%s" "Refreshing package database...")
    (package-refresh-contents)
    (dolist (pkg settings/packages)
      (when (not (package-installed-p pkg))
        (package-install pkg)))))


;; evil
;; - vi emulation mode
(with-library evil
  (loop for (mode . state) in '((git-commit-mode . insert)
                                (git-rebase-mode . emacs)
                                (term-mode . emacs))
        do (evil-set-initial-state mode state))
  (define-key evil-motion-state-map (kbd "RET" ) nil)
  (evil-mode 1)

  (with-library evil-surround
    (global-evil-surround-mode 1)))

;; fiplr
;; - fuzzy file search within version control
(with-library fiplr
  (global-set-key (kbd "C-x f") 'fiplr-find-file))

(with-library helm-config
  (setq helm-split-window-in-side-p t)
  (setq helm-ff-file-name-history-use-recentf t)
  (setq helm-M-x-fuzzy-match t)
  (setq helm-buffers-fuzzy-matching t)
  (global-set-key (kbd "M-x")     'helm-M-x)
  (global-set-key (kbd "C-x C-f") 'helm-find-files)
{'fraction_non_alphanumeric': 0.14734774066797643, 'fraction_numerical': 0.0008419870895312938, 'mean_word_length': 2.651639344262295, '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': '219639', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1255, 'n_words': 287}