(use-packagefiles:ensurenil:custom
(backup-by-copyingt)
(backup-directory-alist '(("."."~/.saves/")))
(delete-old-versionst)
(kept-new-versions6)
(kept-old-versions2)
(version-controlt))
;; (use-package startup;; :ensure nil;; :custom;; (initial-major-mode 'org-mode))
(setq initial-major-mode 'org-mode)
(use-package simple
:ensurenil:custom
(column-number-mode1)
(global-visual-line-mode1))
(use-package autorevert
:custom
(global-auto-revert-mode1))
(setq-default indent-tabs-mode nil)
;; Figure out a better way to manage PATH
(defunmine-make-path-home (relative)
"Take a path relative to home and turn it into an absolute path"
(concat (getenv"HOME") "/"relative))
(setq mine-paths
(list (mine-make-path-home "bin/stack")
(mine-make-path-home ".local/bin")
(mine-make-path-home "bin")))
(setq exec-path (append exec-path mine-paths))
(setenv"PATH" (concat (getenv"PATH") ":" (mapconcat'identity mine-paths ":")))
(add-hook'dired-mode-hook'auto-revert-mode)
(global-unset-key (kbd"s-t"))
Some helper functions
(defunswitch-to-scratch-buffer ()
"Switch to the scratch buffer"
(interactive)
(switch-to-buffer"*scratch*"))
(defunswitch-to-dashboard-buffer ()
"Switch to the dashboard buffer"
(interactive)
(switch-to-buffer"*dashboard*"))
(use-package magit
:commands (magit-status projectile-vc))
(defvarwork-home-dir
(concat (getenv"HOME") "/b/"))
;; Wrapper to clone a work repo
(defunmine-magit-clone-banno (reponame)
"Clone REPO from github and put it in with the rest of the projects"
(interactive"MName of project: ")
(let ((repo-dir (concat work-home-dir reponame "/"))
(remote-repo (concat"git@github.com:banno/" reponame)))
(magit-clone-regular remote-repo repo-dir)))
(defunmine-get-browse-at-remote-url ()
(interactive)
(kill-new (browse-at-remote-get-url)))
(use-package browse-at-remote)
(use-package ghub)
(use-package forge)
(use-package scala-mode
:mode (("\\.scala\\'". scala-mode)
("\\.sbt\\'". scala-mode)
("\\.sc\\'". scala-mode))
:config
(progn
(setq scala-indent:align-parameters t)
(setq scala-indent:align-forms t)))
(use-package sbt-mode
:custom
(sbt:program-options '("-Dsbt.supershell=false"))
:config
(substitute-key-definition'minibuffer-complete-word'self-insert-command
minibuffer-local-completion-map)
(add-hook'sbt-mode-hook '(lambda ()
(setq compilation-skip-threshold 2)))
(add-hook'scala-mode-hook '(lambda ()
(progn
(setq tab-width 2)
(if (and buffer-file-name
(string= (file-name-extension buffer-file-name) "sbt"))
(flycheck-mode -1))))))
(use-package json-mode
:config
(add-hook'json-mode-hook (lambda ()
(make-local-variable'js-indent-level)
(setqjs-indent-level2)
(setqtab-width2))))
(use-package jsonnet-mode)
(use-package haskell-mode
:config
(setq
ghc-ghc-options '("-fno-warn-missing-signatures")
haskell-compile-cabal-build-command "cd %s && stack build"
haskell-process-type 'stack-ghci
haskell-interactive-popup-errors nil
haskell-process-args-stack-ghci '("--ghc-options=-ferror-spans""--with-ghc=ghci-ng")
haskell-process-path-ghci "stack"))
;; (use-package intero;; ;; :config;; (add-hook 'haskell-mode-hook 'intero-mode))
(defunmine-wrap-sbt-start ()
"Check if a file is a .scala file before attempting to launch sbt from it"
(interactive)
(if (eq major-mode 'scala-mode) (sbt-start) (print"Must start sbt from a scala project")))
(use-package fsharp-mode)
(use-package elm-mode)
(use-package yaml-mode)
(use-package ess)
(use-package clojure-mode)
(use-package cider)
(use-package nix-mode)
(use-package terraform-mode)
(use-package sly
:config;; (require 'sly-autoloads)
(setq inferior-lisp-program "/run/current-system/sw/bin/sbcl"))
;; (use-package slime;; :config;; (setq inferior-lisp-program "/run/current-system/sw/bin/sbcl");; (setq slime-contribs '(slime-fancy slime-company)));; (use-package slime-company;; :after (slime company))
(defunmine-sbt-compile ()
"I sure wish I knew how this works"
(interactive)
(sbt-command"compile"))
(defunmine-strip-src-main-from-path-regex (in)
(progn
(replace-regexp-in-string"\/src\/main\/scala\/""" in)
(replace-regexp-in-string"\/src\/test\/scala\/""" in)))
(defunmine-replace-slash-with-dot (in)
(replace-regexp-in-string"\/""."in))
(defunmine-project-relative-file-path ()
"Return a string representing the relative path from whatever projectile thinks is the project root of the current buffer."
(file-name-directory (file-relative-name buffer-file-name (projectile-project-root))))
(defunmine-scala-package-from-path ()
"Chop off the /src/main/scala and format a package declaration string."
(if (stringp buffer-file-name)
(mine-replace-slash-with-dot (mine-strip-src-main-from-path-regex (mine-project-relative-file-path)))
(message"That aint right")))
(use-package typescript-mode)
(use-package vue-mode)
Vterm
(use-package vterm)
Natural language
(use-package markdown-mode
:commands (markdown-mode gfm-mode)
:mode (("README\\.md\\'". gfm-mode)
("\\.md\\'". markdown-mode)
("\\.markdown\\'". markdown-mode))
:init (setq markdown-command "multimarkdown"))
;; TODO: document this
(use-package htmlize)
(use-package writeroom-mode)
(use-package wc-mode)
(defuntext-mode-hooks ()
"Stuff to ensure a nice writing environment for plain text and similar formats."
(visual-line-mode))
(use-package pdf-tools
:config
(pdf-tools-install)
(evil-set-initial-state 'pdf-view-mode'normal))
Purely Aesthetic
(defunmine-reset-modeline-faces ()
"Set all face attributes to something moody can handle."
(let ((line (face-attribute'mode-line:underline)))
(set-face-attribute'mode-linenil:overline line)
(set-face-attribute'mode-line-inactivenil:overline line)
(set-face-attribute'mode-line-inactivenil:underline line)
(set-face-attribute'mode-linenil:boxnil)
(set-face-attribute'mode-line-inactivenil:box line)
(set-face-attribute'mode-line-inactivenil:background (face-attribute'default:background))))
(defuntransparency (value)
"Sets the transparency of the frame window. 0=transparent/100=opaque"
(interactive"nTransparency Value 0 - 100 opaque:")
(set-frame-parameter (selected-frame) 'alphavalue))
(defvarafter-load-theme-hooknil"Hook run after a color theme is loaded using `load-theme'.")
(defadviceload-theme (after run-after-load-theme-hook activate)
"Run `after-load-theme-hook'."
(run-hooks'after-load-theme-hook))
(add-hook'after-load-theme-hook'mine-reset-modeline-faces)
(use-package helm-themes)
(use-package doom-themes)
(menu-bar-mode-1)
(toggle-scroll-bar-1)
(tool-bar-mode-1)
(add-to-list'default-frame-alist '(ns-transparent-titlebar .t))
(add-to-list'default-frame-alist '(ns-appearance . dark)) ;; assuming you are using a dark theme
(setq ring-bell-function 'ignore)
(set-face-attribute'defaultnil:font"Hasklig-14")
(set-frame-font"Hasklig-12"nilt)
(use-package moody
:config
(setq x-underline-at-descent-line t)
(moody-replace-mode-line-buffer-identification)
(moody-replace-vc-mode))
(use-package minions
:config
(minions-mode 1)
;; Workers of the Modeline, unite!
(setq minions-mode-line-lighter "☭"))
(use-package fontawesome
:diminish)
(use-package octicons
:diminish)
;; (use-package dashboard;; :config;; (setq dashboard-banner-logo-title "I believe in you!");; (setq dashboard-startup-banner "~/emacs/lilbub.png");; (setq dashboard-items '((recents . 10);; (projects . 10);; (agenda . 10)));; (dashboard-setup-startup-hook));; LIGATURES BABY
(defunmy-correct-symbol-bounds (pretty-alist)
"Prepend a TAB character to each symbol in this alist, this way compose-region called by prettify-symbols-mode will use the correct width of the symbols instead of the width measured by char-width."
(mapcar (lambda (el)
(setcdrel (string?\t (cdr el)))
el)
pretty-alist))
(defunmy-ligature-list (ligaturescodepoint-start)
"Create an alist of strings to replace with codepoints starting from codepoint-start."
(let ((codepoints (-iterate '1+ codepoint-start (length ligatures))))
(-zip-pair ligatures codepoints)))
; list can be found at https://github.com/i-tu/Hasklig/blob/master/GlyphOrderAndAliasDB#L1588
(setq my-hasklig-ligatures
(let* ((ligs '("&&""***""*>""\\\\""||""|>""::""==""===""==>""=>""=<<""!!"">>"">>="">>>"">>-"">-""->""-<""-<<""<*""<*>""<|""<|>""<$>""<>""<-""<<""<<<""<+>""..""...""++""+++""/="":::"">=>""->>""<=>""<=<""<->")))
(my-correct-symbol-bounds (my-ligature-list ligs #Xe100))))
;; nice glyphs for haskell with hasklig
(defunmy-set-hasklig-ligatures ()
"Add hasklig ligatures for use with prettify-symbols-mode."
(setqprettify-symbols-alist
(append my-hasklig-ligatures prettify-symbols-alist))
(prettify-symbols-mode))
(add-hook'scala-mode-hook'my-set-hasklig-ligatures)
(add-hook'haskell-mode-hook'my-set-hasklig-ligatures)
(set-face-attribute'mode-linenil:boxnil)
(set-face-attribute'mode-line-inactivenil:boxnil)
(use-package centered-window)
(use-package xresources-theme
:if (eq system-type 'gnu/linux))
(use-package emojify
:config
(setq emojify-emoji-styles "unicode")
(add-hook'after-init-hook#'global-emojify-mode))
(use-package ewal
:if (eq system-type 'gnu/linux))
(use-package ewal-doom-themes
:if (eq system-type 'gnu/linux))
Fun things
(use-package elfeed
:config
(setq elfeed-feeds
'(("https://www.archlinux.org/feeds/news/" arch linux)
("https://xkcd.com/rss.xml" fun comic)
("https://www.smbc-comics.com/rss.php" fun comic)
("http://kernel.org/kdist/rss.xml" linux)
("https://reddit.com/r/netflixbestof/.rss" fun netflix))))
(use-package md4rd
:config
(add-hook'md4rd-mode-hook'md4rd-indent-all-the-lines))
(use-package wttrin
:config
(setq wttrin-default-cities '("Memphis""Los Angeles""Chicaco")))