 (define-key osx-key-mode-map [(alt meta j)] 'insert-register)
 (define-key osx-key-mode-map [(alt meta k)] 'copy-to-register)
 
+;; helm
+(use-package helm
+  :ensure t
+  :init
+  (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-x b") 'helm-mini)
+  (global-set-key (kbd "C-x C-f") 'helm-find-files)
+  :config
+  (define-key helm-map (kbd "<tab>") 'helm-execute-persistent-action)
+  (define-key helm-map (kbd "C-z") 'helm-select-action)
+  )
+
 ;; magit
-(setq magit-auto-revert-mode nil)
 (define-key osx-key-mode-map [(alt m)] nil)
-(define-key osx-key-mode-map [(alt m) ?s] 'magit-status)
-(define-key osx-key-mode-map [(alt m) ?d] 'magit-diff)
-(define-key osx-key-mode-map [(alt m) ?c] 'magit-commit)
-(define-key osx-key-mode-map [(alt m) ?C] 'magit-commit-amend)
-(define-key osx-key-mode-map [(alt m) ?r] 'magit-rebase-interactive)
-(define-key osx-key-mode-map [(alt m) ?l] 'magit-log-current)
+(use-package magit
+  :ensure t
+  :init
+  (setq magit-auto-revert-mode nil)
+  :bind (("A-m s" . magit-status)
+         ("A-m d" . magit-diff)
+         ("A-m c" . magit-commit)
+         ("A-m C" . magit-commit-amend)
+         ("A-m r" . magit-rebase-interactive)
+         ("A-m m" . magit-merge)
+         ("A-m l" . magit-log-current)))
 
 ;; Lines
 (defun move-line (n)


;; files
(defmacro hot-file (name)
  `(lambda () (interactive) (find-file ,name)))

(define-key osx-key-mode-map [(alt /) ?s] (hot-buffer "*scratch*"))
(define-key osx-key-mode-map [(alt /) ?e] (hot-file "~/Library/Preferences/Aquamacs Emacs/Preferences.el"))

;; vertical window split
(setq split-width-threshold nil)

;; indentation
(setq-default indent-tabs-mode nil)
(setq-default tab-width 2)
(setq-default py-indent-offset 2)
(setq-default css-indent-offset 2)
(setq-default c-basic-offset 2)
(setq-default js2-basic-offset 2)
(setq-default javascript-indent-level 2)
(setq-default js-indent-level 2)
(setq-default scala-indent-level 2)
(custom-set-variables
 '(python-guess-indent nil)
 '(python-indent 2))

;; auto complete
(setq-default completion-ignore-case t)
