Clean up init files

This commit is contained in:
Henrik Lissner 2015-10-25 00:39:54 -04:00
parent f63d831575
commit accd943e87
2 changed files with 90 additions and 83 deletions

View file

@ -1,41 +1,50 @@
;;; init-load-path.el ;;; init-load-path.el
(fset '! 'eval-when-compile) (setq gc-cons-threshold 84857600)
(defconst narf-emacs-dir user-emacs-directory) (eval-and-compile
(defconst narf-core-dir (concat narf-emacs-dir "core/")) (defconst narf-emacs-dir user-emacs-directory)
(defconst narf-modules-dir (concat narf-emacs-dir "modules/")) (defconst narf-core-dir (concat narf-emacs-dir "core/"))
(defconst narf-contrib-dir (concat narf-emacs-dir "contrib/")) (defconst narf-modules-dir (concat narf-emacs-dir "modules/"))
(defconst narf-private-dir (concat narf-emacs-dir "private/")) (defconst narf-contrib-dir (concat narf-emacs-dir "contrib/"))
(defconst narf-elpa-dir (concat narf-emacs-dir ".cask/" emacs-version "/elpa/")) (defconst narf-private-dir (concat narf-emacs-dir "private/"))
(defconst narf-temp-dir (concat narf-private-dir "cache/" (system-name) "/")) (defconst narf-elpa-dir (concat narf-emacs-dir ".cask/" emacs-version "/elpa/"))
(defconst narf-script-dir (concat narf-emacs-dir "scripts/")) (defconst narf-temp-dir (concat narf-private-dir "cache/" (system-name) "/"))
(defconst narf-snippet-dirs (list (concat narf-private-dir "snippets/") (defconst narf-script-dir (concat narf-emacs-dir "scripts/"))
(concat narf-private-dir "templates/"))) (defconst narf-snippet-dirs (list (concat narf-private-dir "snippets/")
(concat narf-private-dir "templates/"))))
(! (defun --subdirs (path) (eval-when-compile
(let ((result '()) (add-to-list 'load-path "/usr/local/share/emacs/site-lisp/cask")
(paths (ignore-errors (directory-files path t "^[^.]" t)))) (defun --subdirs (path)
(dolist (file paths) (let ((result '())
(when (file-directory-p file) (paths (ignore-errors (directory-files path t "^[^.]" t))))
(add-to-list 'result file))) (dolist (file paths)
result))) (when (file-directory-p file)
(add-to-list 'result file)))
result)))
;; Scan various folders to populate the load-dirs ;; Scan various folders to populate the load-dirs
(setq custom-theme-load-path (setq custom-theme-load-path
(! (append (--subdirs (concat narf-private-dir "themes/")) (eval-when-compile
custom-theme-load-path))) (append (--subdirs (concat narf-private-dir "themes/"))
custom-theme-load-path)))
(setq load-path (setq load-path
(! (require 'cask) (eval-when-compile
(cask-initialize) (require 'cask)
(setq load-path (append (list narf-core-dir narf-contrib-dir narf-modules-dir narf-private-dir) (cask-initialize)
(list (concat narf-core-dir "lib")) (setq load-path (append (list narf-core-dir narf-contrib-dir narf-modules-dir narf-private-dir)
(list (concat narf-modules-dir "lib")) (list (concat narf-core-dir "lib"))
(--subdirs narf-contrib-dir) (list (concat narf-modules-dir "lib"))
load-path)))) (--subdirs narf-contrib-dir)
load-path))))
(defconst IS-MAC (eq system-type 'darwin)) (defconst IS-MAC (eq system-type 'darwin))
(defconst IS-LINUX (eq system-type 'gnu/linux)) (defconst IS-LINUX (eq system-type 'gnu/linux))
(defconst IS-WINDOWS (eq system-type 'windows-nt)) (defconst IS-WINDOWS (eq system-type 'windows-nt))
(when (file-exists-p "~/.emacs.local.el")
(load "~/.emacs.local.el"))
;;; init-load-path.el ends here ;;; init-load-path.el ends here

110
init.el
View file

@ -40,67 +40,65 @@
;; ;;
;;; License: GPLv3 ;;; License: GPLv3
(defconst narf-debug-mode nil) (defconst narf-theme 'narf-dark)
(setq gc-cons-threshold 84857600) ; avoid garbage collection (defconst narf-default-font (font-spec :family "DejaVu Sans Mono" :size 12))
(setq file-name-handler-alist nil) ; premature optimization weee! (defconst narf-big-font (font-spec :family "Ubuntu Mono" :size 18))
(scroll-bar-mode -1) ; no scrollbar (scroll-bar-mode -1) ; no scrollbar
(tool-bar-mode -1) ; no toolbar (tool-bar-mode -1) ; no toolbar
(menu-bar-mode -1) ; no menubar
(defconst narf-default-font (font-spec :family "terminus (ttf)" :size 12 :antialias nil)) ;; prematurely optimize for faster startup
(defconst narf-big-font (font-spec :family "Ubuntu Mono" :size 18 :antialias t)) (let (file-name-handler-alist)
(load (concat user-emacs-directory "init-load-path.el")) (load (concat user-emacs-directory "init-load-path.el"))
(load-theme (if window-system 'narf-dark 'wombat) t) (load-theme narf-theme t)
(set-frame-parameter nil 'fullscreen 'fullboth) (mapc 'require
`(core ; core/core.el
,(cond (IS-MAC 'core-os-osx)
(IS-LINUX 'core-os-linux)
(IS-WINDOWS 'core-os-win32))
(mapc 'require core-ui ; draw me like one of your French editors
`(core ; core/core.el core-evil ; come to the dark side, we have cookies
,(cond (IS-MAC 'core-os-osx) core-editor ; filling the editor-shaped hole in the emacs OS
(IS-LINUX 'core-os-linux) core-company ; for the lazy typist
(IS-WINDOWS 'core-os-win32)) core-yasnippet ; for the lazier typist
core-auto-insert ; for the laziest typist
core-flycheck ; remember that semicolon you forgot?
core-project ; whose project am I in?
core-vcs ; version control is a programmer's best friend
core-helm ; a search engine for life and love
core-quickrun ; run code, run.
core-workgroups ; cure Emacs alzheimers
core-ui ; draw me like one of your French editors module-cc ; c/c++/obj-c madness
core-evil ; come to the dark side, we have cookies ;; module-crystal ; ruby at the speed of c
core-editor ; filling the editor-shaped hole in the emacs OS module-csharp ; unity, .NET, and mono shenanigans
core-company ; for the lazy typist module-collab ; wonewy, I'm so wonewy~
core-yasnippet ; for the lazier typist module-data ; dbs 'n data formats
core-auto-insert ; for the laziest typist module-elisp ; drowning in parentheses
core-flycheck ; remember that semicolon you forgot? module-eshell ; eshell (on windows)
core-project ; whose project am I in? module-go ; a hipster dialect
core-vcs ; version control is a programmer's best friend module-java ; the poster child for carpal tunnel syndome
core-helm ; a search engine for life and love module-js ; alert("not java, javascript!")
core-quickrun ; run code, run. module-lb6 ; LaunchBar 6 development
core-workgroups ; cure Emacs alzheimers module-lua ; one-based indices? one-based indices.
module-markdown ; markdown
module-org ; for fearless [organized] leader
module-plantuml ; to help show how right I am
module-php ; making php less painful to work with
module-python ; beautiful is better than ugly
module-regex ; /^[^\s](meaning)[^\n]*/
module-ruby ; <3
module-rust ; Fe2O3
module-sh ; she sells Z-shells by the C XOR
module-swift ; yay, emoji variables!
module-vim ; my mistress
module-web ; for the 2.0'er
module-cc ; c/c++/obj-c madness my-bindings
;; module-crystal ; ruby at the speed of c my-commands
module-csharp ; unity, .NET, and mono shenanigans ))
module-data ; dbs 'n data formats (narf-init))
module-elisp ; drowning in parentheses
module-eshell ; eshell (on windows)
module-go ; a hipster dialect
module-java ; the poster child for carpal tunnel syndome
module-js ; alert("not java, javascript!")
module-lb6 ; LaunchBar 6 development
module-lua ; one-based indices? one-based indices.
module-markdown ; markdown
module-org ; for fearless [organized] leader
module-php ; making php less painful to work with
module-python ; beautiful is better than ugly
module-regex ; /^[^\s](meaning)[^\n]*/
module-ruby ; <3
module-rust ; Fe2O3
module-sh ; she sells Z-shells by the C shore
module-swift ; yay, emoji variables!
module-vim ; the confessional
module-web ; for the 2.0'er
my-bindings
my-commands
))
(narf-init)
;;; I think so Brain... ;;; I think so Brain...