 
 ;;;; Prepare package manager
 (require 'package)
-(let ((repos '(("melpa stable" . "http://melpa-stable.milkbox.net/packages/")
-	      ("melpa" . "http://melpa.milkbox.net/packages/")
-	      ("marmalade" . "http://marmalade-repo.org/packages/"))))
-  (dolist (repo repos)
-    (add-to-list 'package-archives repo)))
-(add-to-list 'package-archives '("melpa stable" . "http://melpa-stable.milkbox.net/packages/") t)
-(add-to-list 'package-archives '("melpa" . "http://melpa.milkbox.net/packages/") t)
-(add-to-list 'package-archives '("marmalade" . "http://marmalade-repo.org/packages/") t)
+(setq package-archives
+      '(
+	("melpa stable" . "http://melpa-stable.milkbox.net/packages/")
+	("melpa" . "http://melpa.milkbox.net/packages/")
+	("marmalade" . "https://marmalade-repo.org/packages/")
+	("gnu" . "http://elpa.gnu.org/packages/")
+	))
 (package-initialize)
 (comment
  (package-list-packages)  ; list / install / uninstall packages
  )
-;; Installed:
-;;   clojure-mode
-;;   evil
-;;   powerline
-;;   powerline-evil
-;;   cider
-;;   projectile
-;;   linum-relative (melpa latest)
-
-
+
+;; Theses will fail if the package is not installed. Then install the package.
+(require 'clojure-mode)
+(require 'column-marker)
+(require 'dired+)
+(require 'dockerfile-mode)
 (require 'evil)
+(require 'feature-mode)
+(require 'highlight-symbol)
+(require 'linum-relative)  ; need melpa version
+(require 'powerline)
+(require 'powerline-evil)
+(require 'projectile)
 (require 'rainbow-delimiters)
 (require 'uniquify)
-(require 'powerline)
-(require 'powerline-evil)
-(require 'dired+)
-(require 'linum-relative)
+(require 'smooth-scrolling)
 
 
 ;;;; Useful info

	       "#00ffff" "#880000" "#008800" "#0000ff"))
    (set-face-attribute (face i) nil :foreground c)
    (setq i (1+ i))))
(dolist (s '(rainbow-delimiters-mismatched-face rainbow-delimiters-unmatched-face))
  (set-face-attribute s nil :foreground "white" :background "red"))



(setq uniquify-buffer-name-style 'reverse)
(diredp-toggle-find-file-reuse-dir t)  ; Dired+ reuse buffer for changing dirs.
(linum-relative-on)
(cond ((eq system-type 'windows-nt)
       (set-face-attribute 'default nil :font "Liberation Mono-10")))
(setq mouse-wheel-scroll-amount '(3 ((shift) . 1) ((control) . nil)))
(setq mouse-wheel-progressive-speed nil)
(setq smooth-scroll-margin 5)

;; Put backup files and autosave files in temp dir.
(setq backup-directory-alist `((".*" . ,temporary-file-directory)))
(setq auto-save-file-name-transforms `((".*" ,temporary-file-directory t)))

;; Column marker stuff
(dolist (s '(emacs-lisp-mode-hook python-mode-hook))
  (add-hook s (lambda () (column-marker-1 79))))
(set-face-attribute 'column-marker-1 nil :background "red" :foreground "white")
;; aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasdlfk
;; (set-window-margins nil 0 (max (- (window-width) 80) 0))

;; Evil mode
(evil-mode 1)
