              '("melpa" . "http://melpa.milkbox.net/packages/") t)
 (package-initialize)
 
-;;  (package-install 'bind-key))
-(require 'bind-key)
+(if (not (package-installed-p 'use-package))
+    (progn
+      (package-refresh-contents)
+      (package-install 'use-package)))
+(require 'use-package)
+
+(use-package bind-key
+  :ensure bind-key)
 
 ;; From http://pages.sachachua.com/.emacs.d/Sacha.html#sec-1-7-3
 ;; Transpose stuff with M-t

(semantic-mode 1)

(global-set-key (kbd "C-c h o") 'helm-occur)

(define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action) ; rebihnd tab to do persistent action
(define-key helm-map (kbd "C-i") 'helm-execute-persistent-action) ; make TAB works in terminal
(define-key helm-map (kbd "C-z")  'helm-select-action) ; list actions using C-z

(set-face-attribute 'linum nil :background "#333333")
(set-face-attribute 'fringe nil :background "#333333")

(use-package ido-vertical-mode
  :ensure ido-vertical-mode)
(ido-vertical-mode)

(use-package markdown-mode+
  :ensure markdown-mode+)
(autoload 'markdown-mode "markdown-mode"
  "Major mode for editing Markdown files" t)
(add-to-list 'auto-mode-alist '("\\.text\\'" . markdown-mode))
