-;; Time-stamp: <2015-03-12 10:04:22 kmodi>
+;; Time-stamp: <2015-04-22 15:32:46 kmodi>
 
 ;; Ag
 ;; https://github.com/Wilfred/ag.el
 
 (use-package ag
-    :init
+  :init
   (progn
     (bind-to-modi-map "a" ag-project-regexp)
     (bind-to-modi-map "g" ag-project-regexp))


    (bind-keys
     :map ag-mode-map
     ("i" . wgrep-change-to-wgrep-mode)
     ("/" . isearch-forward)
     ("n" . isearch-repeat-forward)
     ("N" . isearch-repeat-backward)
     ("q" . ag-kill-buffers))))


(provide 'setup-ag)

    ;; wgrep-ag : To allow editing in *ag* buffer
    ;; https://github.com/mhayashi1120/Emacs-wgrep
    (use-package wgrep-ag
      :commands (wgrep-ag-setup)
      :config
      (progn
        (add-hook 'ag-mode-hook #'wgrep-ag-setup)
        (bind-keys
         :map wgrep-mode-map
          ("C-x s" . wgrep-save-all-buffers)
          ("C-c C-c" . wgrep-finish-edit) ;; Apply changes to file buffers
          ("C-c C-e" . wgrep-finish-edit)
          ("C-x C-s" . wgrep-finish-edit)
          ("C-c C-d" . wgrep-mark-deletion)
          ("C-c C-p" . wgrep-toggle-readonly-area)
          ("C-c C-r" . wgrep-remove-change)
          ("C-c C-u" . wgrep-remove-all-change)
          ("C-c C-[" . wgrep-remove-all-change)
          ("C-c C-k" . wgrep-abort-changes)
          ("C-x C-q" . wgrep-exit))))

    ;; Set default ag arguments
    (setq ag-arguments (list "--smart-case" "--nogroup" "--column"))
