Last active
December 17, 2015 11:29
-
-
Save lancelet/5602791 to your computer and use it in GitHub Desktop.
NOTE: This now has its own repository: https://github.com/lancelet/dotemacs
Yes, it's sad, I know. My .emacs file. It comes with an accompanying shell script which sets up the ~/.emacs.d/vendor directory with required additions. This isn't guaranteed to work for anyone but me.
This file contains hidden or 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
;---------------------------------------; | |
; JONATHAN MERRITT'S EMACS STARTUP FILE ; | |
;---------------------------------------; | |
; Setup: | |
; | |
; 1. Create vendor directory: | |
; > mkdir -p ~/.emacs.d/vendor | |
; | |
; 2. Install milkypostman/powerline (cute status bar / modeline): | |
; > cd ~/.emacs.d/vendor | |
; > git clone https://github.com/milkypostman/powerline.git | |
; | |
; 3. Install ensime (scala mode for emacs): | |
; > cd ~/.emacs.d/vendor | |
; > wget https://www.dropbox.com/sh/ryd981hq08swyqr/ZiCwjjr_vm/ENSIME%20Releases/ensime_2.10.0-0.9.8.9.tar.gz | |
; > tar -xzf ensime_2.10.0-0.9.8.9.tar.gz | |
; > rm ensime_2.10.0-0.9.8.9.tar.gz | |
; | |
; 4. Install julia mode: | |
; > cd ~/.emacs.d/vendor | |
; > wget https://raw.github.com/JuliaLang/julia/master/contrib/julia-mode.el | |
; Default font | |
(set-default-font "-apple-Inconsolata-light-normal-normal-*-14-*-*-*-m-0-iso10646-1") | |
; Set fullscreen shortcut key to be M-RET | |
(defun toggle-fullscreen () | |
"Toggle full screen" | |
(interactive) | |
(when window-system | |
(set-frame-parameter | |
nil 'fullscreen | |
(when (not (frame-parameter nil 'fullscreen)) 'fullboth)) )) | |
(global-set-key (kbd "M-RET") 'toggle-fullscreen) | |
; Visual customizations | |
(tool-bar-mode 0) ; turn off tool bar | |
(setq inhibit-splash-screen t) ; no splash | |
(setq visible-bell 1) ; visible bell (square in the middle of the screen) - not audio | |
; Window size | |
(if (window-system) | |
(set-frame-size (selected-frame) 120 30)) | |
; Stop emacs from saving backup files | |
(setq make-backup-files nil) | |
; Emacs powerline (cute modeline / status bar graphics) | |
(add-to-list 'load-path "~/.emacs.d/vendor/powerline") | |
(require 'powerline) | |
(set-face-attribute 'powerline-active1 nil :box nil :foreground "LightGrey") | |
(set-face-attribute 'powerline-active2 nil :box nil) | |
(set-face-attribute 'mode-line nil :box nil :background "OliveDrab3" :foreground "grey14") | |
(set-face-attribute 'powerline-inactive1 nil :box nil) | |
(set-face-attribute 'powerline-inactive2 nil :box nil) | |
(set-face-attribute 'mode-line-inactive nil :box nil) | |
(set-face-attribute 'mode-line-highlight nil :box nil) | |
(powerline-default-theme) | |
(add-hook 'window-setup-hook 'powerline-reset) ; get coloring of arrows correct | |
; Package mechanism | |
(require 'package) | |
(add-to-list 'package-archives | |
'("melpa" . "http://melpa.milkbox.net/packages/") t) | |
(package-initialize) | |
; Color theme | |
(unless (package-installed-p 'color-theme) | |
(package-refresh-contents) (package-install 'color-theme)) | |
(require 'cl) | |
(require 'color-theme) | |
(color-theme-initialize) | |
(color-theme-charcoal-black) | |
(set-face-background 'region "#304030") | |
; Scala-mode 2 | |
(unless (package-installed-p 'scala-mode2) | |
(package-refresh-contents) (package-install 'scala-mode2)) | |
; Column marker | |
(unless (package-installed-p 'column-marker) | |
(package-refresh-contents) (package-install 'column-marker)) | |
(require 'column-marker) | |
(add-hook 'scala-mode-hook (lambda () (interactive) (column-marker-1 120))) | |
(column-number-mode) | |
; Ensime | |
(add-to-list 'load-path "~/.emacs.d/vendor/ensime_2.10.0-0.9.8.9/elisp/") | |
(require 'ensime) | |
(add-hook 'scala-mode-hook 'ensime-scala-mode-hook) | |
; Haskell mode | |
(unless (package-installed-p 'haskell-mode) | |
(package-refresh-contents) (package-install 'haskell-mode)) | |
(require 'haskell-mode) | |
(custom-set-variables '(haskell-mode-hook '(turn-on-haskell-indentation))) | |
; Sr-Speedbar | |
(unless (package-installed-p 'sr-speedbar) | |
(package-refresh-contents) (package-install 'sr-speedbar)) | |
(require 'sr-speedbar) | |
; Smooth scrolling | |
(unless (package-installed-p 'smooth-scrolling) | |
(package-refresh-contents) (package-install 'smooth-scrolling)) | |
(require 'smooth-scrolling) | |
; scroll one line at a time (less "jumpy" than defaults) | |
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1))) ; one line at a time | |
(setq mouse-wheel-progressive-speed nil) ; don't accelerate scrolling | |
(setq mouse-wheel-follow-mouse 't) ; scroll window under mouse | |
(setq scroll-step 1) ; keyboard scroll one line at a time | |
; Julia language syntax highlighting | |
(load "~/.emacs.d/vendor/julia-mode.el") | |
(require 'julia-mode) | |
; Set parameters for video recording | |
(defun set-for-recording () | |
"Set up for video screencast (half of 1280x720)" | |
(interactive) | |
(set-default-font "-apple-Inconsolata-light-normal-normal-*-18-*-*-*-m-0-iso10646-1") | |
(powerline-reset) | |
(scroll-bar-mode -1) | |
(set-frame-size (selected-frame) 71 38) | |
) | |
; Additions to the exec-path | |
(setq exec-path (append exec-path `("/usr/local/bin"))) | |
; Set JAVA_HOME to use JDK 8 | |
(setq jdk-dir "/Library/Java/JavaVirtualMachines/jdk1.8.0_b87.jdk") | |
(setq java-home (concat jdk-dir "/Contents/Home")) | |
(setenv "JAVA_HOME" java-home) |
This file contains hidden or 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
#!/bin/bash | |
echo "--------------------------------------------" | |
echo "| Setting up for Jonathan Merritt's EMACS! |" | |
echo "--------------------------------------------" | |
if [ -d "~/.emacs.d/vendor" ]; then | |
echo "Creating vendor directory ~/.emacs.d/vendor" | |
mkdir -p ~/.emacs.d/vendor | |
fi | |
echo "Updating / installing milkypostman/powerline (cute status bar / modeline)" | |
cd ~/.emacs.d/vendor | |
if [ -d "powerline" ]; then | |
echo "--> already installed; updating via git" | |
cd powerline | |
git pull | |
else | |
echo "--> not installed; performing a git clone" | |
git clone https://github.com/milkypostman/powerline.git | |
fi | |
echo "Ensime (scala mode for emacs)" | |
cd ~/.emacs.d/vendor | |
if [ ! -d "ensime_2.10.0-0.9.8.9" ]; then | |
echo "--> not installed, doing a wget and extraction" | |
wget https://www.dropbox.com/sh/ryd981hq08swyqr/ZiCwjjr_vm/ENSIME%20Releases/ensime_2.10.0-0.9.8.9.tar.gz | |
tar xzf ensime_2.10.0-0.9.8.9.tar.gz | |
rm ensime_2.10.0-0.9.8.9.tar.gz | |
else | |
echo "--> already installed" | |
fi | |
echo "Julia mode" | |
cd ~/.emacs.d/vendor | |
if [ ! -e "julia-mode.el" ]; then | |
echo "--> not installed, doing a wget" | |
wget https://raw.github.com/JuliaLang/julia/master/contrib/julia-mode.el | |
else | |
echo "--> already installed" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment