       '("~/.emacs.d/yasnippets/personal"))
 (yas-reload-all)
 
-(use-package helm
-  :ensure helm)
-
 ;; From http://tuhdo.github.io/helm-intro.html
 ;; must set before helm-config,  otherwise helm use default
 ;; prefix "C-x c", which is inconvenient because you can
 ;; accidentially pressed "C-x C-c"
 (setq helm-command-prefix-key "C-c h")
 
-(require 'helm-config)
-(require 'helm-files)
-(require 'helm-grep)
-(require 'helm-eshell)
-(require 'helm-buffers)
-
-(use-package helm-ag-r
-  :ensure helm-ag-r)
-(require 'helm-ag-r)
-
-(use-package helm-swoop
-  :ensure helm-swoop)
-(require 'helm-swoop)
+(use-package helm
+  :init
+  (progn
+    (use-package helm-ag
+      :ensure helm-ag)
+    (use-package helm-buffers)
+    (use-package helm-files)
+    (use-package helm-grep)
+    (use-package helm-swoop)
+    (use-package helm-config))
+  :ensure helm)
+
+(defun ar/projectile-helm-ag ()
+  (interactive)
+  (helm-do-ag (projectile-project-root)))
+
+;; Use ag for grepping git project.
+(bind-key "C-c s r" 'ar/projectile-helm-ag)
+;; Use ag for grepping from current location.
+(bind-key "C-c s d" 'helm-do-ag)
 
 (use-package helm-dash
-  :ensure helm-dash)
-(require 'helm-dash)
+  :ensure helm-dash
+  :demand)
+;;(require 'helm-dash)
 (setq helm-dash-browser-func 'eww)
 
 (global-set-key (kbd "M-C-s") 'helm-multi-swoop-all)

(objc-font-lock-global-mode)
(setq objc-font-lock-background-face nil)

(add-hook 'objc-mode-hook (lambda ()
                            (set (make-local-variable 'company-backends)
                                 ;; List with multiple back-ends for mutual inclusion.
                                 '((company-yasnippet
                                    company-gtags
                                    company-dabbrev-code
                                    company-files)))
                            (company-mode)
                            ;; List targets with xcodebuild -list
                            ;; List SDKS with xcodebuild -sdk -version, for example:
                            ;; iPhoneSimulator7.1.sdk - Simulator - iOS 7.1 (iphonesimulator7.1)
                            ;; SDKVersion: 7.1
                            ;; Path: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk
                            ;; PlatformPath: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform
                            ;; ProductBuildVersion: 11D167
                            ;; ProductCopyright: 1983-2014 Apple Inc.
                            ;; ProductName: iPhone OS
                            ;; ProductVersion: 7.1
                            (setq compile-command "xcodebuild -sdk iphonesimulator7.1 -target MyTarget")
                            (define-key objc-mode-map [f6] 'recompile)
                            (define-key objc-mode-map [f7] 'ar/xc:build)
                            (define-key objc-mode-map [f8] 'ar/xc:run)))

;; No Objective-C 'other file' support out of the box. Fix that.
(setq cc-other-file-alist
      `(("\\.cpp$" (".hpp" ".h"))

  (whitespace-mode)
  (rainbow-delimiters-mode)
  (yas-minor-mode))
(add-hook 'prog-mode-hook 'ar/prog-mode-hook)

(use-package centered-cursor-mode
