summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--emacs.d/init.el51
-rw-r--r--emacs.d/init.el~47
-rw-r--r--emacs.d/packages.el162
3 files changed, 260 insertions, 0 deletions
diff --git a/emacs.d/init.el b/emacs.d/init.el
new file mode 100644
index 0000000..ede81b9
--- /dev/null
+++ b/emacs.d/init.el
@@ -0,0 +1,51 @@
+;; no menu
+(menu-bar-mode -1)
+
+;; show parenthesis
+(show-paren-mode +1)
+
+;; and lose the stupid pipe chars on the split-screen bar
+(set-face-foreground 'vertical-border "white")
+(set-face-background 'vertical-border "white")
+
+;; alias yes-or-no to y-or-n
+(fset 'yes-or-no-p 'y-or-n-p)
+
+;; set utf-8 as the default encoding
+(prefer-coding-system 'utf-8-unix)
+
+(autoload 'ibuffer "ibuffer" "List buffers." t)
+
+(require 'whitespace)
+(global-whitespace-mode 1)
+
+;;; set some variables
+;; add a new line at the end of the file
+(setq
+ auto-save-default nil
+ auto-save-list-file-prefix nil
+ frame-title-format '(buffer-file-name "%f" ("%b"))
+ inhibit-startup-message t
+ make-backup-files nil
+ require-final-newline t
+ tab-always-indent 'complete
+ vc-follow-symlinks t
+ whitespace-style '(face trailing tabs tab-mark))
+
+;; twitter's default
+(setq-default
+ c-basic-offset 2
+ indent-tabs-mode nil
+ python-indent-offset 2
+ scala-indent:use-javadoc-style t
+ sh-basic-offset 2
+ sh-indentation 2)
+
+;;; some bindings
+(global-set-key (kbd "M-j") 'join-line)
+(global-set-key (kbd "C-x C-b") 'ibuffer)
+
+;;; if our version is >24 and we have the emacs24.el file, load it.
+(when (>= emacs-major-version 24)
+  (if (file-exists-p "~/.emacs.d/packages.el")
+      (load "~/.emacs.d/packages.el")))
diff --git a/emacs.d/init.el~ b/emacs.d/init.el~
new file mode 100644
index 0000000..6d513cb
--- /dev/null
+++ b/emacs.d/init.el~
@@ -0,0 +1,47 @@
+;; no menu
+(menu-bar-mode -1)
+
+;; show parenthesis
+(show-paren-mode +1)
+
+;; and lose the stupid pipe chars on the split-screen bar
+(set-face-foreground 'vertical-border "white")
+(set-face-background 'vertical-border "white")
+
+;; alias yes-or-no to y-or-n
+(fset 'yes-or-no-p 'y-or-n-p)
+
+;; set utf-8 as the default encoding
+(prefer-coding-system 'utf-8-unix)
+
+(autoload 'ibuffer "ibuffer" "List buffers." t)
+
+(require 'whitespace)
+(global-whitespace-mode 1)
+
+;;; set some variables
+;; add a new line at the end of the file
+(setq
+ auto-save-default nil
+ auto-save-list-file-prefix nil
+ frame-title-format '(buffer-file-name "%f" ("%b"))
+ inhibit-startup-message t
+ make-backup-files nil
+ require-final-newline t
+ tab-always-indent 'complete
+ vc-follow-symlinks t
+ whitespace-style '(face trailing tabs))
+
+(setq-default indent-tabs-mode nil
+	      python-indent-offset 2
+	      sh-basic-offset 2
+	      sh-indentation 2)
+
+;;; some bindings
+(global-set-key (kbd "M-j") 'join-line)
+(global-set-key (kbd "C-x C-b") 'ibuffer)
+
+;;; if our version is >24 and we have the emacs24.el file, load it.
+(when (>= emacs-major-version 24)
+  (if (file-exists-p "emacs24.el")
+            (load "~/.emacs.d/emacs24.el")))
diff --git a/emacs.d/packages.el b/emacs.d/packages.el
new file mode 100644
index 0000000..e4df87d
--- /dev/null
+++ b/emacs.d/packages.el
@@ -0,0 +1,162 @@
+;;; packages.el --- External packages configured via `use-package'
+
+;;; Commentary:
+
+(require 'package)
+
+;;; Code:
+(setq package-archives
+      (append package-archives
+              '(("melpa" . "http://melpa.milkbox.net/packages/"))
+              '(("org" . "http://orgmode.org/elpa/"))))
+
+(package-initialize)
+(setq package-enable-at-startup nil)
+
+(unless package-archive-contents
+  (message "Refreshing ELPA package archives...")
+  (package-refresh-contents))
+
+(unless (package-installed-p 'use-package)
+  (message "`use-package' not found.  Installing...")
+  (package-install 'use-package))
+
+(require 'use-package)
+(setq use-package-minimum-reported-time 0
+      use-package-verbose t)
+
+(use-package color-theme-sanityinc-tomorrow
+  :ensure t)
+
+(use-package diminish
+  :ensure t
+  :config
+  (progn
+    (eval-after-load "whitespace" '(diminish 'whitespace-mode))))
+
+(use-package fill-column-indicator
+  :ensure t
+  :defer t
+  :init
+  (progn
+    (add-hook 'prog-mode-hook 'fci-mode)))
+
+(use-package flycheck
+  :ensure t
+  :defer t
+  :init
+  (progn
+    (setq-default fci-rule-column 80)
+    (add-hook 'prog-mode-hook 'flycheck-mode)))
+
+(use-package gist
+  :ensure t
+  :bind ("C-c g p" . gist-region-or-buffer-private)
+  :config
+  (setq gist-view-gist t))
+
+(use-package git-commit
+  :ensure t
+  :defer t)
+
+(use-package gitconfig-mode
+  :ensure t
+  :defer t)
+
+(use-package gitignore-mode
+  :ensure t
+  :defer t)
+
+(use-package go-mode
+  :ensure t
+  :defer t
+  :init
+  (defun go-capitalize-previous-word ()
+    (interactive)
+    (backward-word)
+    (capitalize-word 1))
+  :config
+  (progn
+    (bind-key "C-c C-c" 'go-capitalize-previous-word go-mode-map)
+    (bind-key "C-c f" 'gofmt go-mode-map)
+    (bind-key "C-c d" 'godoc go-mode-map)))
+
+(use-package google-c-style
+  :ensure t
+  :defer t)
+
+(use-package goto-chg
+  :ensure t
+  :bind (("C-." . goto-last-change)
+         ("C-," . goto-last-change-reverse)))
+
+(use-package magit
+  :ensure t
+  :bind ("C-x g" . magit-status)
+  :config
+  (progn
+    (setenv "GIT_PAGER" "")
+    (setq magit-completing-read-function 'magit-ido-completing-read)))
+
+(use-package markdown-mode
+  :ensure t
+  :mode ("\\.\\(m\\(ark\\)?down\\|md\\)$" . markdown-mode)
+  :init
+  (add-hook 'markdown-mode-hook 'spell-check-and-wrap-at-80)
+  :config
+  (progn
+    (let ((preferred-markdown-impl "peg-markdown"))
+      (when (executable-find preferred-markdown-impl)
+        (setq markdown-command preferred-markdown-impl)))))
+
+(use-package mustache-mode
+  :ensure t
+  :defer t)
+
+(use-package projectile
+  :ensure t
+  :diminish projectile-mode
+  :init
+  (setq projectile-enable-caching t)
+  :config
+  (projectile-global-mode))
+
+(use-package puppet-mode
+  :ensure t
+  :mode ("\\.pp$" . puppet-mode))
+
+(use-package rainbow-delimiters
+  :ensure t
+  :defer t
+  :init
+  (progn
+    (add-hook 'emacs-lisp-mode-hook #'rainbow-delimiters-mode)))
+
+(use-package scala-mode2
+  :ensure t
+  :defer t)
+
+(use-package smartparens
+  :ensure t
+  :diminish smartparens-mode
+  :config
+  (progn
+    (require 'smartparens-config)
+    (smartparens-global-mode 1)))
+
+(use-package thrift
+  :ensure t
+  :defer t)
+
+(use-package yaml-mode
+  :ensure t
+  :defer t)
+
+(use-package server
+  :config
+  (unless (server-running-p)
+    (server-start)))
+
+(provide 'packages)
+
+;;; packages.el ends here