 (bind-key "M-t M-t" 'transpose-words)
 (bind-key "M-t s" 'transpose-sexps)
 
-;; (package-install 'rainbow-delimiters)
-(require 'rainbow-delimiters)
+(use-package rainbow-delimiters
+  :ensure rainbow-delimiters)
 (global-rainbow-delimiters-mode)
 
-(unless (fboundp 'hungry-delete-mode)
-  (package-install 'hungry-delete))
-(require 'hungry-delete)
+(use-package hungry-delete
+  :ensure hungry-delete)
 (global-hungry-delete-mode)
-
 (global-auto-revert-mode)
 (global-font-lock-mode)
 
-;;(unless (fboundp 'expand-region)
-;;  (package-install 'expand-region))
-(require 'expand-region)
+(use-package expand-region
+  :ensure expand-region)
 (global-set-key (kbd "C-c w") 'er/expand-region)
 
-(require 'helm)
+(use-package helm
+  :ensure helm)
 
 ;; From http://tuhdo.github.io/helm-intro.html
 ;; must set before helm-config,  otherwise helm use default

(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

(require 'helm-grep)
(require 'helm-eshell)
(require 'helm-buffers)

(use-package helm-swoop
  :ensure helm-swoop)

(global-set-key (kbd "M-C-s") 'helm-swoop)
(global-set-key (kbd "C-s") 'isearch-forward-regexp)
(global-set-key (kbd "C-r") 'isearch-backward-regexp)
