Skip to content

Commit

Permalink
Switch to `use-package' in more places
Browse files Browse the repository at this point in the history
  • Loading branch information
ubolonton committed Apr 24, 2019
1 parent 9cf99f9 commit cd81723
Show file tree
Hide file tree
Showing 18 changed files with 269 additions and 304 deletions.
4 changes: 4 additions & 0 deletions config/ublt-appearance.el
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,10 @@


;;;Color theme
(ublt/with-defer
(use-package monokai-theme)
(use-package zenburn-theme)
(use-package solarized-theme))
(when (y-or-n-p "Load theme?")
(if (window-system)
(ublt/set-up 'ublt-dark-theme
Expand Down
2 changes: 2 additions & 0 deletions config/ublt-communication.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

;;; Twitter
(use-package twittering-mode
:defer t
:custom ((twittering-status-format
"%i %s%RT{%FACE[ublt-twitter-meta-face]{ ♽ }%FACE[ublt-twitter-meta-retweet]{%s}}%FACE[ublt-twitter-meta-reply]{%r}%FACE[ublt-twitter-meta-face]{ %@}%FACE[ublt-twitter-meta-location]{ from %f%L}\n %t")
(twittering-url-show-status nil)
Expand Down Expand Up @@ -39,6 +40,7 @@
;;; ERC

(use-package erc
:defer t
:straight nil
:custom ((erc-autojoin-channels-alist
'(("freenode.net" "#emacs" "#conkeror" "#clojure" "#concatenative" "#flink")))
Expand Down
6 changes: 5 additions & 1 deletion config/ublt-devops.el
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
(require 'ublt-util)

(use-package terraform-mode)
(ublt/with-defer
(use-package terraform-mode)
(use-package dockerfile-mode)
(use-package systemd)
(use-package inf-mongo))

(use-package company-terraform
:after (company terraform-mode)
Expand Down
5 changes: 3 additions & 2 deletions config/ublt-dired.el
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@
:custom (dired-isearch-filenames 'dwim))

;; Directories first by default. "s d" to change locally
(ublt/set-up 'dired-sort-map
(setq dired-listing-switches "--group-directories-first -alhG1v"))
(use-package dired-sort-map
:straight nil
:custom (dired-listing-switches "--group-directories-first -alhG1v"))

(use-package all-the-icons-dired
:hook (dired-mode . all-the-icons-dired-mode))
Expand Down
18 changes: 9 additions & 9 deletions config/ublt-dvorak.el
Original file line number Diff line number Diff line change
Expand Up @@ -380,15 +380,15 @@
"M-<mouse-4>" 'scroll-down-line
"M-<mouse-5>" 'scroll-up-line)

(ublt/set-up 'helpful
(ublt/define-keys global-map
"C-h f" 'helpful-callable
"C-h w" 'helpful-command
"C-h k" 'helpful-key
"C-h v" 'helpful-variable
"C-h o" 'helpful-symbol
"C-h s" 'helpful-at-point
"C-h C-s" 'helpful-at-point))
(use-package helpful
:config (ublt/define-keys global-map
"C-h f" 'helpful-callable
"C-h w" 'helpful-command
"C-h k" 'helpful-key
"C-h v" 'helpful-variable
"C-h o" 'helpful-symbol
"C-h s" 'helpful-at-point
"C-h C-s" 'helpful-at-point))

(when window-system
(ublt/define-keys global-map
Expand Down
20 changes: 9 additions & 11 deletions config/ublt-editing.el
Original file line number Diff line number Diff line change
Expand Up @@ -158,22 +158,20 @@ See `http://ergoemacs.org/emacs/modernization_upcase-word.html'

;;; Yasnippet --------------------------------------------------------

(use-package yasnippet
:custom (yas-choose-keys-first t)
;; Don't, use a dedicate key binding for yas
;; (add-to-list 'hippie-expand-try-functions-list 'yas-hippie-try-expand)
:config
(add-to-list 'yas-snippet-dirs "~/.emacs.d/data/yasnippet/snippets")
(yas-global-mode +1))
(ublt/with-defer
(use-package yasnippet
:custom (yas-choose-keys-first t)
;; Don't, use a dedicate key binding for yas
;; (add-to-list 'hippie-expand-try-functions-list 'yas-hippie-try-expand)
:config
(add-to-list 'yas-snippet-dirs "~/.emacs.d/data/yasnippet/snippets")
(yas-global-mode +1))

(use-package yasnippet-snippets)
(use-package yasnippet-snippets))


;;; Misc

;;; Recompile Emacs Lisp on-save.
(use-package auto-compile)

;;; TODO: Use this
(defun ublt/remove-hard-wrap ()
;;; TODO: Unfill paragraphs one-by-one, skipping those that should not
Expand Down
18 changes: 4 additions & 14 deletions config/ublt-erlang.el
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
(require 'ublt-util)

(ublt/set-up 'erlang
(add-to-list 'auto-mode-alist '("\\.rel$" . erlang-mode)))
(use-package erlang
:mode ("\\.rel$" . erlang-mode))

;; (ublt/set-up 'edts
;; (add-hook 'after-init-hook (lambda () (ublt/set-up 'edts-start))))

;;; XXX
(add-hook 'erlang-mode-hook (ublt/off-fn 'auto-complete-mode) t)

;; Syntax checking
(ublt/set-up 'flycheck
;; (add-hook 'erlang-mode-hook (ublt/on-fn 'flycheck-mode))

;; XXX
(add-hook 'erlang-mode-hook (ublt/off-fn 'flymake-mode) t))
(use-package flycheck
:hook (erlang-mode . flycheck-mode))

(provide 'ublt-erlang)
7 changes: 3 additions & 4 deletions config/ublt-flycheck.el
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
(require 'flycheck)

(defgroup ubolonton nil ""
:group 'personal)

Expand All @@ -16,7 +14,8 @@
'face 'ublt/flycheck-message-face)
flycheck-error-message-buffer))))

(setq flycheck-display-errors-delay 0
flycheck-display-errors-function #'ublt/flycheck-display-error-messages)
(use-package flycheck
:custom ((flycheck-display-errors-delay 0)
(flycheck-display-errors-function #'ublt/flycheck-display-error-messages)))

(provide 'ublt-flycheck)
6 changes: 3 additions & 3 deletions config/ublt-haskell.el
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(require 'ublt-util)

(ublt/set-up 'haskell-mode
(add-to-list 'auto-mode-alist '("\\.hs$" . haskell-mode))
(add-hook 'haskell-mode-hook 'turn-on-haskell-indentation))
(use-package haskell-mode
:mode "\\.hs$"
:hook (haskell-mode . turn-on-haskell-indentation))

(provide 'ublt-haskell)
114 changes: 59 additions & 55 deletions config/ublt-lisp.el
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
(require 'ublt-util)
(require 'dash)

(use-package dash)

(defface ublt/lisp-paren-face
'((((class color) (background dark))
Expand All @@ -16,73 +17,76 @@
clojurescript-mode))
(font-lock-add-keywords mode '(("(\\|)" . 'ublt/lisp-paren-face))))

;; Scheme
(ublt/set-up 'quack
(setq quack-fontify-style nil))

(ublt/set-up 'paredit
(dolist (hook '(scheme-mode-hook
emacs-lisp-mode-hook
lisp-mode-hook
ielm-mode-hook
clojure-mode-hook
cider-repl-mode-hook))
(add-hook hook (ublt/on-fn 'paredit-mode) t)))

(ublt/set-up 'lisp-mode
(ublt/set-up 'eldoc
(add-hook 'emacs-lisp-mode-hook (ublt/on-fn 'eldoc-mode)))
(use-package paredit
:config (dolist (hook '(scheme-mode-hook
emacs-lisp-mode-hook
lisp-mode-hook
ielm-mode-hook
clojure-mode-hook
cider-repl-mode-hook))
(add-hook hook (ublt/on-fn 'paredit-mode) t)))

(ublt/set-up 'auto-compile
(auto-compile-on-save-mode +1)
(setq auto-compile-display-buffer nil))
(use-package eldoc
:hook (emacs-lisp-mode . eldoc-mode))

(ublt/set-up 'elisp-slime-nav
(add-hook 'emacs-lisp-mode-hook (ublt/on-fn 'elisp-slime-nav-mode)))
;;; Recompile Emacs Lisp on-save.
(use-package auto-compile
:custom (auto-compile-display-buffer nil)
:config (auto-compile-on-save-mode +1))

(ublt/set-up 'lisp-extra-font-lock
(lisp-extra-font-lock-global-mode +1)))
(use-package elisp-slime-nav
:hook (emacs-lisp-mode . elisp-slime-nav-mode))

(ublt/set-up 'ielm
(add-hook 'ielm-mode-hook
(lambda () (setq comint-input-ring-file-name "~/.emacs.d/.ielm-input.hist"))))
(use-package lisp-extra-font-lock
:config (lisp-extra-font-lock-global-mode +1))

(ublt/set-up 'clojure-mode
(add-to-list 'auto-mode-alist '("\\.dtm$" . clojure-mode))
(define-clojure-indent
(facts '(:defn (1)))
(fact '(:defn (1)))))
(use-package ielm
:hook (ielm-mode . (lambda () (setq comint-input-ring-file-name "~/.emacs.d/.ielm-input.hist"))))

(ublt/set-up 'clj-refactor
(setq cljr-suppress-no-project-warning t))
(ublt/with-defer
(use-package cask-mode)

(ublt/set-up 'cider
(setq cider-prompt-for-symbol nil
cider-font-lock-dynamically '(macro core var deprecated))
;; Scheme
(use-package quack
:custom (quack-fontify-style nil))

(ublt/in '(darwin)
(setq cider-jdk-src-paths (-> "find /Library/Java/JavaVirtualMachines -name src.zip | head -n 1"
shell-command-to-string string-trim list)))
(use-package clojure-mode
:mode "\\.dtm$"
:config (define-clojure-indent
(facts '(:defn (1)))
(fact '(:defn (1)))))

(add-hook 'cider-mode-hook #'cider-company-enable-fuzzy-completion)
(add-hook 'cider-mode-hook (ublt/on-fn 'eldoc-mode))
(use-package clj-refactor
:custom (cljr-suppress-no-project-warning t))

(ublt/set-up 'cider-repl
(setq cider-repl-display-help-banner nil
cider-repl-use-pretty-printing t
cider-repl-popup-stacktraces t
cider-repl-wrap-history t
(use-package cider
:custom ((cider-prompt-for-symbol nil)
(cider-font-lock-dynamically '(macro core var deprecated)))

cider-repl-history-file "~/.emacs.d/.nrepl.hist"
cider-repl-history-highlight-current-entry t
cider-repl-history-highlight-inserted-item 'pulse
cider-repl-history-current-entry-face 'secondary-selection
cider-repl-history-inserted-item-face 'secondary-selection
:config (ublt/in '(darwin)
(setq cider-jdk-src-paths (-> "find /Library/Java/JavaVirtualMachines -name src.zip | head -n 1"
shell-command-to-string string-trim list)))

nrepl-log-messages t
nrepl-hide-special-buffers t))
:hook ((cider-mode . cider-company-enable-fuzzy-completion)
(cider-mode . eldoc-mode)))

(use-package helm-cider
:config (helm-cider-mode +1)))
:config (helm-cider-mode +1))

(use-package cider-repl
:straight cider
:custom ((cider-repl-display-help-banner nil)
(cider-repl-use-pretty-printing t)
(cider-repl-popup-stacktraces t)
(cider-repl-wrap-history t)

(cider-repl-history-file "~/.emacs.d/.nrepl.hist")
(cider-repl-history-highlight-current-entry t)
(cider-repl-history-highlight-inserted-item 'pulse)
(cider-repl-history-current-entry-face 'secondary-selection)
(cider-repl-history-inserted-item-face 'secondary-selection)

(nrepl-log-messages t)
(nrepl-hide-special-buffers t))))

(provide 'ublt-lisp)
39 changes: 20 additions & 19 deletions config/ublt-markups.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,29 @@
(defun ublt/tab-2-spaces ()
(setq tab-width 2))

(ublt/set-up 'markdown-mode
(setq markdown-fontify-code-blocks-natively t
markdown-asymmetric-header t
markdown-spaces-after-code-fence 0
markdown-hide-urls t)
(add-to-list 'auto-mode-alist '("\\.md$" . gfm-mode))
(add-to-list 'auto-mode-alist '("\\.markdown$" . gfm-mode))
(add-hook 'markdown-mode-hook #'ublt/run-prog-mode-hook))
(use-package markdown-mode
:custom ((markdown-fontify-code-blocks-natively t)
(markdown-asymmetric-header t)
(markdown-spaces-after-code-fence 0)
(markdown-hide-urls t))
:mode (("\\.md$" . gfm-mode)
("\\.markdown$" . gfm-mode))
:hook (markdown-mode . ublt/run-prog-mode-hook))

(ublt/set-up 'yaml-mode
(add-hook 'yaml-mode-hook 'ublt/tab-2-spaces)
(add-hook 'yaml-mode-hook (ublt/off-fn 'variable-pitch-mode))
(add-hook 'yaml-mode-hook #'ublt/run-prog-mode-hook)
(add-to-list 'auto-mode-alist '("\\.yaml$" . yaml-mode)))
(use-package yaml-mode
:mode "\\.yaml$"
:hook ((yaml-mode . (lambda () (setq tab-width 2)))
(yaml-mode . (lambda () (variable-pitch-mode -1)))
(yaml-mode . ublt/run-prog-mode-hook)))

(ublt/set-up 'adoc-mode
(add-to-list 'auto-mode-alist '("\\.asciidoc$" . adoc-mode)))
(use-package adoc-mode
:mode "\\.asciidoc$")

(ublt/set-up 'mustache-mode
(add-to-list 'auto-mode-alist '("\\.mustache$" . mustache-mode)))
(use-package mustache-mode
:mode "\\.mustache$")

(ublt/set-up 'conf-mode
(add-to-list 'auto-mode-alist '("Pipfile$" . conf-toml-mode)))
(use-package conf-mode
:straight nil
:mode ("Pipfile$" . conf-toml-mode))

(provide 'ublt-markups)
Loading

0 comments on commit cd81723

Please sign in to comment.