Last active
December 26, 2015 04:09
-
-
Save meandavejustice/7091347 to your computer and use it in GitHub Desktop.
my current .emacs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(load-theme 'kvn-spacey t) | |
(require 'package) | |
;; Add the original Emacs Lisp Package Archive | |
(add-to-list 'package-archives | |
'("elpa" . "http://tromey.com/elpa/")) | |
(add-to-list 'package-archives | |
'("marmalade" . "http://marmalade-repo.org/packages/")) | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.milkbox.net/packages/")) | |
(package-initialize) | |
;; Defaults | |
(menu-bar-mode -1) ;; minimal chrome | |
(tool-bar-mode -1) ;; no toolbar | |
(defalias 'qrr 'query-regexp-replace) | |
(defalias 'yes-or-no-p 'y-or-n-p) ;; only type y instead of yes | |
(setq inhibit-splash-screen t) ;; no splash screen | |
(setq-default indent-tabs-mode nil) ;; no tabs! | |
(setq fill-column 80) ;; M-q should fill at 80 chars, not 75 | |
(setq-default truncate-lines 1) ;; no wordwrap | |
(menu-bar-mode -1) ;; minimal chrome | |
(tool-bar-mode -1) ;; no toolbar | |
(require 'fill-column-indicator) ;; line indicationg some edge column | |
;; normalize copy and paste for osx | |
(defun copy-from-osx () | |
(shell-command-to-string "pbpaste")) | |
(defun paste-to-osx (text &optional push) | |
(let ((process-connection-type nil)) | |
(let ((proc (start-process "pbcopy" "*Messages*" "pbcopy"))) | |
(process-send-string proc text) | |
(process-send-eof proc)))) | |
(if (eq system-type 'darwin) | |
(progn | |
(setq interprogram-cut-function 'paste-to-osx) | |
(setq interprogram-paste-function 'copy-from-osx))) | |
;; global package preferences | |
;; textmate mode | |
(require 'textmate) | |
(textmate-mode) | |
(add-to-list '*textmate-project-roots* "~/Code") | |
(require 'pretty-mode) | |
(pretty-mode) | |
; yasnippet | |
(add-to-list 'load-path | |
"~/.emacs.d/elpa/yasnippet-0.8.0/") | |
(require 'yasnippet) | |
(yas-global-mode 1) | |
(add-to-list 'load-path "~/path-to/auto-complete") | |
; Load the default configuration | |
(require 'auto-complete-config) | |
; Make sure we can find the dictionaries | |
(add-to-list 'ac-dictionary-directories "~/.emacs.d/elpa/auto-complete-20130724/dict") | |
; Use dictionaries by default | |
(setq-default ac-sources (add-to-list 'ac-sources 'ac-source-dictionary)) | |
(global-auto-complete-mode t) | |
; Start auto-completion after 2 characters of a word | |
(setq ac-auto-start 2) | |
; case sensitivity is important when finding matches | |
(setq ac-ignore-case nil) | |
;; Syntax specific preferences | |
; set js2 mode for all .js files | |
(require 'js2-mode) | |
(add-to-list 'auto-mode-alist '("\\.js\\'" . js2-mode)) | |
(setq-default js2-basic-offset 2) | |
(setq js-indent-level 2) | |
; CSS defaults | |
(setq css-indent-offset 2) | |
(require 'web-mode) | |
(add-to-list 'auto-mode-alist '("\\.hb\\.html\\ " . web-mode)) | |
(add-to-list 'auto-mode-alist '("\\.html\\ " . web-mode)) | |
; everything is indented 2 spaces | |
(setq web-mode-markup-indent-offset 2) | |
(setq web-mode-css-indent-offset 2) | |
(setq web-mode-code-indent-offset 2) | |
(require 'server) | |
(unless (server-running-p) | |
(server-start)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment