;;; Slime/etc
(setq inferior-lisp-program "/opt/homebrew/bin/sbcl")
(load (expand-file-name "~/.local/opt/quicklisp/slime-helper.el"))

; Smooth mouse scroll a bit
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1) ((control) . nil)))
(setq mouse-wheel-progressive-speed nil)

;; normal home/end behavior
(global-set-key (kbd "<home>") 'beginning-of-line)
(global-set-key (kbd "<end>") 'end-of-line)

;;; erc config
(setq erc-nick "speskk")

(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))

;; packages to install and load
(straight-use-package 'auto-complete)
(straight-use-package '(nano-theme :type git :host github
:repo "rougier/nano-theme"))
;;(straight-use-package
;; '(nano-emacs :type git :host github :repo "rougier/nano-emacs"))
(straight-use-package
'(slime-company :type git :host github :repo "anwyn/slime-company"))
(straight-use-package 'sublimity)
(straight-use-package 'dashboard)
(straight-use-package 'all-the-icons)
(straight-use-package 'neotree)
(straight-use-package 'rust-mode)
(straight-use-package 'powerline)
(straight-use-package 'markdown-mode)
(straight-use-package 'moe-theme)
(straight-use-package 'ample-theme)
(straight-use-package 'slime)
(straight-use-package 'ac-slime)
;; Not enabled/required by default
(straight-use-package 'evil)
(straight-use-package 'dimmer)
(straight-use-package 'magit)
(straight-use-package 'diff-hl)
(straight-use-package 'powerline-evil)

;; Git stuff
(require 'magit)
(require 'diff-hl)
(global-diff-hl-mode)
(add-hook 'magit-pre-refresh-hook 'diff-hl-magit-pre-refresh)
(add-hook 'magit-post-refresh-hook 'diff-hl-magit-post-refresh)

;; Easily set cua mode on/off so that I don't have to
;; use shift+insert for paste on mac
(global-set-key (kbd "C-c c") 'cua-mode)

(require 'dimmer)
(setq dimmer-fraction 0.4)
(dimmer-mode t)

;; always enable ido mode
(require 'ido)
(ido-mode t)

(require 'evil)
(evil-mode 1)

;; Enable tab behavior like vi
(straight-use-package '(evil-tabs :type git :host github
:repo "krisajenkins/evil-tabs"))
(require 'evil-tabs)
(global-evil-tabs-mode t)

(require 'auto-complete)
(global-auto-complete-mode t)

(require 'slime)
(require 'ac-slime)
(slime-setup '(slime-fancy ac-slime))
(add-hook 'slime-mode-hook 'set-up-slime-ac)
(add-hook 'slime-repl-mode-hook 'set-up-slime-ac)
(eval-after-load "auto-complete"
'(add-to-list 'ac-modes 'slime-repl-mode))

(require 'markdown-mode)

(require 'powerline)
(powerline-default-theme)
;; Better powerline support for evil mode
(require 'powerline-evil)

(require 'neotree)
(global-set-key [f8] 'neotree-toggle)

(require 'dashboard)
(dashboard-setup-startup-hook)

(require 'all-the-icons)

(require 'sublimity)
(require 'sublimity-scroll)
(require 'sublimity-map) ;; experimental
(require 'sublimity-attractive)
(setq sublimity-scroll-weight 10
sublimity-scroll-drift-length 5)
(setq sublimity-map-size 30)
(setq sublimity-map-fraction 0.3)
(setq sublimity-map-text-scale -5)
(sublimity-map-set-delay nil)
(setq sublimity-attractive-centering-width nil)

;(add-to-list 'default-frame-alist '(font . "GohuFont" ))
;(set-face-attribute 'default t :font "GohuFont" )

(setq backup-directory-alist
`((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms
`((".*" ,temporary-file-directory t)))

;(load-theme 'moe-light t)
(if (display-graphic-p)
(progn
(load-theme 'nano t)
(nano-dark))
nil)

;; Allow M-up / M-down behavior to switch windows
(windmove-default-keybindings 'meta)

(display-time-mode t)
(display-line-numbers-mode t)

;;; Custom commands
(load "/Users/swatson/.emacs.d/.erc-auth.el")
(defun connect-to-libera-erc () (interactive)
(erc :server "irc.libera.chat" :port "6667"
:nick "speskk" :password *libera-chat*))

(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(custom-safe-themes
'("27a1dd6378f3782a593cc83e108a35c2b93e5ecc3bd9057313e1d88462701fcd" "f703efe04a108fcd4ad104e045b391c706035bce0314a30d72fbf0840b355c2c" "c9ddf33b383e74dac7690255dd2c3dfa1961a8e8a1d20e401c6572febef61045" "01106ca9b4446341ecb86a76b9db48f1100e2eb13980aa0ec6f6adf8e69fd9a7" "bf798e9e8ff00d4bf2512597f36e5a135ce48e477ce88a0764cfb5d8104e8163" "0feb7052df6cfc1733c1087d3876c26c66410e5f1337b039be44cb406b6187c6" default))
'(diff-hl-margin-mode t)
'(display-time-mode t)
'(frame-background-mode 'dark))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(default ((t (:family "CodingFontTobi" :foundry "nil" :slant normal :weight normal :height 181 :width normal)))))