diff options
author | Vincent Ambo <vincent@spotify.com> | 2013-08-06T22·49+0200 |
---|---|---|
committer | Vincent Ambo <vincent@spotify.com> | 2013-08-06T22·49+0200 |
commit | 503600091e63ebe63c8a84ec6b8a6120ff89dc23 (patch) | |
tree | 861408eb7b1854d956d1e73f41030205c636ba41 | |
parent | 43a99dea3aa6651b1b060ace714bddc1e10925ea (diff) |
* Providing all init files, loading them with require
* Moved load-file-if-exists to init-functions * Added init-misc.el for random things that don't fit anywhere else * Never any tabs, ever. Go away! Bindings: * quit Emacs -> C-x r q ("real quit") * delete-frame -> C-x C-c * make-frame -> C-x C-n
-rw-r--r-- | init-bindings.el | 11 | ||||
-rw-r--r-- | init-eshell.el | 2 | ||||
-rw-r--r-- | init-functions.el | 6 | ||||
-rw-r--r-- | init-misc.el | 9 | ||||
-rw-r--r-- | init-modes.el | 2 | ||||
-rw-r--r-- | init-settings.el | 4 | ||||
-rw-r--r-- | init.el | 20 |
7 files changed, 43 insertions, 11 deletions
diff --git a/init-bindings.el b/init-bindings.el index d4026f157b50..2242bf733e9a 100644 --- a/init-bindings.el +++ b/init-bindings.el @@ -44,3 +44,14 @@ ;; Replace standard goto-line with goto-line-with-feedback (global-set-key (kbd "M-g g") 'goto-line-with-feedback) + +;; Goodness from @magnars +;; I don't need to kill emacs that easily +;; the mnemonic is C-x REALLY QUIT +(global-set-key (kbd "C-x r q") 'save-buffers-kill-terminal) +(global-set-key (kbd "C-x C-c") 'delete-frame) + +;; Create new frame +(define-key global-map (kbd "C-x C-n") 'make-frame-command) + +(provide 'init-bindings) diff --git a/init-eshell.el b/init-eshell.el index 239a9980ce3e..58c5888512e8 100644 --- a/init-eshell.el +++ b/init-eshell.el @@ -96,3 +96,5 @@ (interactive) (let ((inhibit-read-only t)) (erase-buffer))) + +(provide 'init-eshell) diff --git a/init-functions.el b/init-functions.el index 4814cee5d322..9cae3c677dd8 100644 --- a/init-functions.el +++ b/init-functions.el @@ -43,6 +43,10 @@ (unless (file-exists-p fullpath) (async-shell-command (concat "git clone " url " " fullpath))))) +(defun load-file-if-exists (filename) + (if (file-exists-p filename) + (load filename))) + ;; These come from magnars, he's got some awesome things. (defun goto-line-with-feedback () @@ -127,3 +131,5 @@ Including indent-buffer, which should not be called automatically on save." (defun speak (m &optional voice) (shell-command (if 'voice (concat "say -v " voice " \"" m "\"") (concat "say " m)))) + +(provide 'init-functions) diff --git a/init-misc.el b/init-misc.el new file mode 100644 index 000000000000..87343205b771 --- /dev/null +++ b/init-misc.el @@ -0,0 +1,9 @@ +;; For everything that doesn't fit anywhere else. + +;; Ignore .DS_Store files with ido mode +(add-to-list 'ido-ignore-files "\\.DS_Store") + +;; Use aspell for spell checking: brew install aspell --lang=en +(setq ispell-program-name "/usr/local/bin/aspell") + +(provide 'init-misc) diff --git a/init-modes.el b/init-modes.el index 9c505f3ff2e3..fc4923c200e4 100644 --- a/init-modes.el +++ b/init-modes.el @@ -57,3 +57,5 @@ ;; Transparently open compressed files (auto-compression-mode t) + +(provide 'init-modes) diff --git a/init-settings.el b/init-settings.el index bc167fb17247..2f22f42a04af 100644 --- a/init-settings.el +++ b/init-settings.el @@ -45,6 +45,8 @@ (add-to-list 'safe-local-variable-values '(lexical-binding . t)) (add-to-list 'safe-local-variable-values '(whitespace-line-column . 80)) +(set-default 'indent-tabs-mode nil) + ;; ido-mode is like magic pixie dust! (ido-mode t) (ido-ubiquitous t) @@ -229,3 +231,5 @@ comment as a filename." (global-set-key (kbd "C-c g") 'magit-status) (remove-hook 'kill-buffer-query-functions 'server-kill-buffer-query-function) + +(provide 'init-settings) diff --git a/init.el b/init.el index a85e4c4b49de..191acf884775 100644 --- a/init.el +++ b/init.el @@ -46,24 +46,22 @@ (when (not (package-installed-p p)) (package-install p))) +;; Are we on a mac? +(setq is-mac (equal system-type 'darwin)) -(load "~/.emacs.d/init-functions.el") +(add-to-list 'load-path user-emacs-directory) + +(mapc 'require '(init-functions + init-settings + init-modes + init-bindings + init-eshell)) (add-to-list 'load-path "~/.emacs.d/scripts/") (setq custom-file "~/.emacs.d/init-custom.el") (load custom-file) - -(load "~/.emacs.d/init-settings.el") -(load "~/.emacs.d/init-modes.el") -(load "~/.emacs.d/init-bindings.el") -(load "~/.emacs.d/init-eshell.el") - -(defun load-file-if-exists (filename) - (if (file-exists-p filename) - (load filename))) - ;; A file with machine specific settings. (load-file-if-exists "~/.emacs.d/init-local.el") |