Overhaul rcfiles; fast startup!

This commit is contained in:
Henrik Lissner 2014-08-07 18:35:22 -04:00
parent 3231a145e7
commit 0b5c7add55
31 changed files with 940 additions and 819 deletions

92
init.el
View file

@ -8,81 +8,41 @@
;;
;;; Code:
(cd "~") ; Default directory, instead of /
;; (setq debug-on-error t)
(cd "~") ; Default directory, instead of /
(setq skip-installs t) ; Don't check packages (for slightly speedier startup)
;; (setq use-package-verbose t)
(server-mode t)
(unless (server-running-p) (server-start))
(desktop-save-mode t)
;; Global vars
(defvar my-dir (file-name-directory load-file-name))
(defvar my-core-dir (expand-file-name "init" my-dir))
(defvar my-modules-dir (expand-file-name "modules" my-dir))
(defvar my-themes-dir (expand-file-name "themes" my-dir))
(defvar my-elisp-dir (expand-file-name "elisp" my-dir))
(defvar my-tmp-dir (expand-file-name "tmp" my-dir))
(defvar my/dir (file-name-directory load-file-name))
(defvar my/init-dir (expand-file-name "init" my/dir))
(defvar my/themes-dir (expand-file-name "themes" my/dir))
(defvar my/elisp-dir (expand-file-name "elisp" my/dir))
(defvar my/tmp-dir (expand-file-name "tmp" my/dir))
(defvar my/snippets-dir (expand-file-name "snippets" my/dir))
;; Setup loadpaths
(add-to-list 'load-path my-core-dir)
(add-to-list 'load-path my-modules-dir)
(add-to-list 'load-path my-elisp-dir)
(add-to-list 'custom-theme-load-path my-themes-dir)
(defvar my/theme 'brin)
(defvar my/font "Inconsolata-14")
;; Font & color scheme
(load-theme 'brin t)
(defvar my-font "Inconsolata-14")
(add-to-list 'load-path my/init-dir)
;;;;;;;;;;;;;;;;;;;;;;;
;; Bootstrap
;;;;;;;;;;;;;;;;;;;;;;;
(dolist (module '(
;; Just the... bear necessities...
core ; Emacs core settings
core-packages ; Package init & management
core-ui ; Look and behavior of the emacs UI
core-editor ; Text/code editor settings and behavior
core-osx ; OSX-specific settings & functions
core-project ; Project navigation settings & packages
(mapc 'require
'(core ; Just the... bear necessities...
;; Modules to improve on emacs' heresy
mod-ac ; Auto-complete engine & settings
mod-snippets ; Snippet engine
mod-git ; GIT tools/settings
mod-fly ; Syntax and spell checkers
mod-emmet ; Zen-coding for HTML+CSS
; mod-shell ; Terminal emulator settings
init-project ; Project navigation tools & settings
init-ac ; Auto-complete engine & settings
init-snippets ; Snippet engine
init-git ; GIT tools/settings
init-fly ; Syntax and spell checker
;; Must be last
core-keymaps ; Global & local keybindings for all modes
mod-text ; Plain text editing (markdown, text)
mod-org ; Org-mode: personal gtd/notes
mod-dev ; Generic environment for all programming
mod-webdev ; Environment for webdev (SCSS, PHP, Rails, Jekyll)
mod-gamedev ; Environment for gamedev (C++, Lua, HTML5, etc)
mod-eclim ; Integration into eclipse (for Java)
))
(require module))
;;;; Modes ;;;;;;;;;;;;;;;;;;;;;;;;
;; Associates a mode with a path regex. If the third parameter is t,
;; then don't try to install the mode (use for modes that are included
;; with emacs).
(associate-mode 'ruby-mode '("\\.rb\\'" "\\.rake\\'" "Rakefile\\'"))
(associate-mode 'markdown-mode '("\\.md\\'" "\\.markdown\\'" "/README"))
(associate-mode 'scss-mode '("\\.scss\\'"))
(associate-mode 'org-mode '("\\.org\\'" "\\.gtd\\'") t)
(associate-mode 'js-mode '("\\.js\\'") t)
(associate-mode 'json-mode '("\\.json\\'" "\\.jshintrc\\'"))
(associate-mode 'web-mode '("\\.\\(p\\)?htm\\(l\\)?\\'" "\\.tpl\\(\\.php\\)?\\'" "\\.erb\\'"))
(associate-mode 'lua-mode '("\\.lua\\'"))
(associate-mode 'yaml-mode '("\\.yml\\'"))
(associate-mode 'python-mode '("\\.py\\'"))
(associate-mode 'c++-mode '("\\.h\\'") t)
(associate-mode 'shell-script-mode '("\\.zsh\\(rc\\|env\\)?\\'") t)
;; Specific mode-configs: DON'T NEED TO REQUIRE THESE.
;; They're here for your gf-ing convenience.
; modules/env-js-mode.el
; modules/env-ruby-mode.el
; modules/env-python-mode.el
; modules/env-lua-mode.el
; modules/env-python-mode.el
;;