 ;; (require 'font-lock)
 ;; (global-font-lock-mode t)
 
-; manage filling paragraphs
+;; Package management
+(require 'package)
+(setq
+ package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
+		    ("org" . "http://orgmode.org/elpa/")
+		    ("melpa" . "https://melpa.org/packages/")
+		    ("melpa-stable" . "https://stable.melpa.org/packages/")))
+(package-initialize)
+(when (not
+       package-archive-contents)
+  (package-refresh-contents)
+  (package-install 'use-package))
+
 (add-hook 'text-mode-hook
           '(lambda () (auto-fill-mode t) ))
 (add-hook 'text-mode-hook

 '(browse-url-generic-program "google-chrome")
 '(case-fold-search t)
 '(column-number-mode t)
 '(desktop-dirname "~/.emacs.d" t)
 '(display-time-24hr-format t)
 '(exec-path (quote ("/usr/local/bin" "/usr/bin" "/bin" "/usr/sbin" "/sbin")))

            ;; Set dired-x buffer-local variables here.  For example:
            ;; (dired-omit-mode 1)
            ))

;; HELM
(global-set-key (kbd "M-x") 'helm-M-x)
(global-set-key (kbd "C-x C-m") 'helm-M-x)
(global-set-key (kbd "C-c C-m") 'helm-M-x)
(global-set-key (kbd "C-x b") 'helm-mini)

;; ENSIME for Scala
(setq exec-path (append exec-path '("/usr/local/bin")))
(setq exec-path (append exec-path '("/usr/local/sbin")))
(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))
(use-package ensime
	     :pin melpa-stable)
;(add-hook 'scala-mode-hook 'ensime-scala-mode-hook)

;; (require 'whitespace)
;; (setq whitespace-line-column 80)
