Commit 5179ed64 authored by Arjen Wiersma's avatar Arjen Wiersma

Move custom config to custom.el, use init-dir.

parent b90f2f53
......@@ -20,7 +20,11 @@
;; When using Homebrew on the macOS
(setq cider-lein-command "/usr/local/bin/lein")
;; When following along with Project Trivia
(setq cider-cljs-lein-repl "(do (use 'figwheel-sidecar.repl-api) (start-figwheel!) (cljs-repl))"))
(setq cider-cljs-lein-repl "(do (use 'figwheel-sidecar.repl-api) (start-figwheel!) (cljs-repl))")
:config
(add-hook 'cider-repl-mode-hook #'eldoc-mode))
(use-package clj-refactor
:ensure t
......@@ -38,6 +42,7 @@
;; Install code completion and enable it globally
(use-package company
:ensure t
:bind (("C-c /". company-complete))
:config
(global-company-mode))
......@@ -45,6 +50,11 @@
(use-package magit
:ensure t)
(use-package which-key
:ensure t
:config
(which-key-mode))
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
......
......@@ -15,22 +15,3 @@
(setq init-dir (file-name-directory (or load-file-name (buffer-file-name))))
(org-babel-load-file (expand-file-name "loader.org" init-dir))
(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
(quote
("cdbd0a803de328a4986659d799659939d13ec01da1f482d838b68038c1bb35e8" default)))
'(package-selected-packages
(quote
(command-log-mode clojure-snippets projectile f git-gutter-fringe all-the-icons js2-mode yaml-mode telephone-line zenburn zenburn-theme spaceline powerline org2blog which-key web-mode wakatime-mode use-package restclient request rainbow-delimiters perspective paredit-everywhere markdown-mode magit less-css-mode htmlize highlight-parentheses emmet-mode counsel company clj-refactor bm arjen-grey-theme ace-window ace-jump-mode))))
(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.
'(mode-line ((t (:background "#2a2f38" :foreground "#bdc3ce"))))
'(mode-line-inactive ((t (:inherit mode-line :background "#2a2f38" :foreground "#666" :weight light)))))
......@@ -71,6 +71,14 @@ python -m pip install --user certifi
* Previous customizations
#+BEGIN_SRC emacs-lisp
(setq custom-file (concat init-dir "custom.el"))
(load custom-file :noerror)
#+END_SRC
* Installing use-package
** Setup
......@@ -111,9 +119,9 @@ Initialize the archive and refresh the contents in case there is no cached archi
#+BEGIN_SRC emacs-lisp
(package-initialize)
(unless (and (file-exists-p "~/.emacs.d/elpa/archives/gnu")
(file-exists-p "~/.emacs.d/elpa/archives/melpa")
(file-exists-p "~/.emacs.d/elpa/archives/melpa-stable"))
(unless (and (file-exists-p (concat init-dir "elpa/archives/gnu"))
(file-exists-p (concat init-dir "elpa/archives/melpa"))
(file-exists-p (concat init-dir "elpa/archives/melpa-stable")))
(package-refresh-contents))
#+END_SRC
......@@ -417,8 +425,8 @@ Install dictionaries from the [[https://addons.mozilla.org/en-us/firefox/languag
Have the ability to use some amazing font icons
#+BEGIN_SRC emacs-lisp
(use-package all-the-icons
:ensure t)
;; (use-package all-the-icons
;; :ensure t)
#+END_SRC
Be sure to install the fonts from [[https://github.com/domtronn/all-the-icons.el/tree/master/fonts][the github repo]].
......@@ -460,7 +468,7 @@ Now, lets make sure we are not `ding`-ed all the time.
(defun custom-persp/emacs ()
(interactive)
(custom-persp "emacs"
(find-file "~/.emacs.d/init.el")))
(find-file (concat init-dir "init.el"))))
(define-key persp-mode-map (kbd "C-x p e") 'custom-persp/emacs)
......@@ -511,7 +519,7 @@ You will need the ox-leanpub library from GitHub.
Now for the leanpub-export.
#+BEGIN_SRC emacs-lisp
(add-to-list 'load-path (expand-file-name "~/.emacs.d/ox-leanpub"))
(add-to-list 'load-path (expand-file-name (concat init-dir "ox-leanpub")))
(load-library "ox-leanpub")
;;; http://www.lakshminp.com/publishing-book-using-org-mode
......@@ -704,20 +712,20 @@ Hydras are the most awesome thing in the world. Check out [[https://github.com/a
*** Time Management
#+BEGIN_SRC emacs-lisp
(defun read-wakatime-api-key ()
"Read the wakatime api key from .wakatime"
(with-temp-buffer
(insert-file-contents-literally "~/.wakatime")
(s-trim (buffer-substring-no-properties (point-min) (point-max)))))
(use-package wakatime-mode
:if (eq system-type 'darwin)
:diminish wakatime-mode
:ensure t
:config
(setq wakatime-api-key (read-wakatime-api-key))
(setq wakatime-cli-path "/usr/local/bin/wakatime")
(global-wakatime-mode))
;; (defun read-wakatime-api-key ()
;; "Read the wakatime api key from .wakatime"
;; (with-temp-buffer
;; (insert-file-contents-literally "~/.wakatime")
;; (s-trim (buffer-substring-no-properties (point-min) (point-max)))))
;;
;; (use-package wakatime-mode
;; :if (eq system-type 'darwin)
;; :diminish wakatime-mode
;; :ensure t
;; :config
;; (setq wakatime-api-key (read-wakatime-api-key))
;; (setq wakatime-cli-path "/usr/local/bin/wakatime")
;; (global-wakatime-mode))
#+END_SRC
*** Look and feel
......@@ -780,7 +788,7 @@ sign.
:diminish yas
:config
(yas/global-mode 1)
(add-to-list 'yas-snippet-dirs "~/.emacs.d/snippets"))
(add-to-list 'yas-snippet-dirs (concat init-dir "snippets")))
(use-package clojure-snippets
:ensure t)
......@@ -795,6 +803,12 @@ sign.
:config
(global-company-mode)
)
;; (use-package company-flx
;; :ensure t
;; :config
;; (with-eval-after-load 'company
;; (company-flx-mode +1)))
#+END_SRC
*** Version Control
......@@ -908,7 +922,7 @@ Retrieve the Cider-Hydra package from [[https://github.com/clojure-emacs/cider-h
#+BEGIN_SRC emacs-lisp
(load-library "~/.emacs.d/cider-hydra.el")
(load-library (concat init-dir "cider-hydra.el"))
(require 'cider-hydra)
#+END_SRC
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment