       kept-old-versions 2
       version-control t)
 
-(setenv "LANG"   "en_US.UTF-8")
-(setenv "LC_ALL" "en_US.UTF-8")
-(prefer-coding-system 'utf-8)
-(set-language-environment "UTF-8")
-(setenv "GO111MODULE" "on")
-
+(defvar bootstrap-version)
 (let ((bootstrap-file
        (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory))
       (bootstrap-version 5))
-  (unless (file-exists-p bootstrap-file)
-    (with-current-buffer
-        (url-retrieve-synchronously
-         "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
-         'silent 'inhibit-cookies)
-      (goto-char (point-max))
-      (eval-print-last-sexp)))
   (load bootstrap-file nil 'nomessage))
 
 (straight-use-package 'use-package)
 
 (require 'package)
 (add-to-list 'package-archives
-             '("melpa" . "https://melpa.org/packages/"))
-
-(when (memq window-system '(mac ns x))
-  (exec-path-from-shell-initialize))
-
-;; (add-to-list 'load-path (expand-file-name "scripts" "~/.emacs.d"))
-;; (require 'resize-frame)
-
-;; Automatically :ensure each use-package.
-;; (setq use-package-always-pin "melpa")
-(use-package poet-theme :straight t)
-(use-package ayu-theme :straight t)
-(use-package mood-one-theme :straight t)
-(use-package github-theme :straight t)
-(use-package melancholy-theme :straight t)
-(use-package avk-emacs-themes :straight t)
-(use-package color-theme-modern :straight t)
-
-;; (load-theme 'github t)
-;; (load-theme 'poet-dark-monochrome t)
-;; (load-theme 'poet-dark t)
-;; (load-theme 'poet t)
-;; (load-theme 'ayu-light t)
-;; (load-theme 'wombat t)
-;; (load-theme 'leuven t)
-;; (load-theme 'mood-one t)
-;; (load-theme 'modus-vivendi t)
-;; (load-theme 'adwaita t)
-;; (load-theme 'leuven t)
-;; (load-theme 'whateveryouwant t)
-(load-theme 'avk-daylight t)
-
-;; (straight-use-package 'deadgrep)
-(use-package deadgrep :straight t :bind (("C-c C-s"  . deadgrep)))
-
-(use-package annotate :straight t)
-
-(use-package projectile-ripgrep :straight t)
-
-(use-package consult :straight t)
-
-(use-package consult-recoll
-  :straight (consult-recoll
-             :type git
-             :branch "main"
-             :repo "https://codeberg.org/jao/consult-recoll"))
-
-;; (use-package package-utils-upgrade-all-and-recompile
-;;  :commands (package-utils-upgrade-all-and-recompile)
-
-;;  :straight
-;;  (package-utils-upgrade-all-and-recompile
-;;    :type git
-;;    :host gitlab
-;;    :repo "ideasman42/emacs-package-utils-upgrade-all-and-recompile"))
-
-;; (straight-use-package 'company)
+	     '("melpa" . "https://melpa.org/packages/"))
+
+(progn
+  (use-package poet-theme :straight t)
+  (use-package mood-one-theme :straight t)
+  (use-package github-theme :straight t)
+  (use-package avk-emacs-themes :straight t)
+  (use-package ayu-theme :straight t))
+
+(load-theme 'github t)
+
+(use-package prescient :straight t :defer t
+  :config (prescient-persist-mode +1))
+
+(use-package ivy :straight t :demand t :diminish ivy-mode
+  :init
+  (setq ivy-use-virtual-buffers t
+        ivy-initial-inputs-alist nil
+        ivy-re-builders-alist '((t . ivy--regex-fuzzy))
+        ivy-extra-directories nil)
+  :config
+  (define-key ivy-minibuffer-map (kbd "C-l") (kbd "DEL"))
+  (use-package flx :straight t :defer t)
+  (use-package ivy-prescient :straight t :defer t)
+  (ivy-mode)
+  (ivy-prescient-mode)
+  :bind (("C-c C-r" . ivy-resume)
+         ("<f6>"    . ivy-resume)
+         ("s-b"     . ivy-switch-buffer)
+         :map ivy-minibuffer-map
+         ("TAB"     . ivy-alt-done)
+         ("<escape>" . minibuffer-keyboard-quit)
+         ("C-j"      . ivy-next-line)
+         ("C-k"      . ivy-previous-line)))
+
+(use-package swiper :straight t
+  :config
+  (global-set-key "\C-s" 'swiper))
+
+(use-package deadgrep :straight t :bind (("C-c C-s" . deadgrep)))
+
 (use-package company
   :straight t
   :diminish
   :config
   (global-company-mode t)
   (setq ;; Only 2 letters required for completion to activate.
-        company-minimum-prefix-length 2
+        company-minimum-prefix-length 3
         ;; Search other buffers for completion candidates
         company-dabbrev-other-buffers t
         company-dabbrev-code-other-buffers t

(add-to-list 'term-file-aliases '("alacritty" . "xterm"))

(setq auto-window-vscroll nil)
(global-auto-revert-mode t)
(menu-bar-mode -1)
;; (tool-bar-mode -1)
;; (scroll-bar-mode -1)
(global-linum-mode t)

(setq custom-file (expand-file-name "custom.el" user-emacs-directory))
(when (file-exists-p custom-file)
  (load custom-file))

(setq straight-recipes-gnu-elpa-use-mirror    t
      straight-repository-branch              "develop"
      straight-enable-use-package-integration t
      warning-minimum-level :error)

(defvar bootstrap-version)

(defconst default-snapshot-dir (expand-file-name "snapshots" user-emacs-directory))

(add-hook 'before-save-hook 'delete-trailing-whitespace)

(setq-default indent-tabs-mode nil
              tab-width 3)

(setq inhibit-startup-screen t
      initial-scratch-message nil
      initial-major-mode 'text-mode
      make-backup-files nil

        ;; Immediately activate completion.
        company-idle-delay 0.5))

(use-package magit
  :straight t
  :commands magit-status
  :hook ((magit-popup-mode-hook . no-trailing-whitespace)
	 (git-commit-mode . goto-address-mode)))

(use-package projectile :straight t :diminish projectile-mode
  :init
  (setq projectile-enable-caching t
        projectile-require-project-root t
	projectile-cache-file (expand-file-name "projectile.cache" default-snapshot-dir)
	projectile-known-projects-file (expand-file-name "projectile-bookmarks.eld" default-snapshot-dir)
	projectile-completion-system 'ivy
        projectile-indexing-method 'alien
        projectile-project-root-files-functions '(projectile-root-local
                                                  projectile-root-top-down
                                                  projectile-root-top-down-recurring
                                                  projectile-root-bottom-up)
	projectile-switch-project-action #'projectile-find-dir)
  :config
  (projectile-mode)
  :bind (("C-c f" . projectile-find-file)
	 ("C-c p" . projectile-switch-project)))

(use-package treemacs :straight t
  :config
