   (use-package helm-ag
     :defer t
     :init
-    (defun spacemacs/helm-do-ag-region-or-symbol (&optional basedir)
-      "Calls `helm-do-ag' with a default string of the escaped
-active region or the symbol at the point if there is no active
-region. Requires \"ag\" search tool."
-      (interactive)
-      (unless (executable-find "ag")
-        (error "ag not available"))
-      (setq helm-ag--original-window (selected-window))
-      (helm-ag--clear-variables)
-      (let* ((helm-ag--default-directory (or basedir default-directory))
-             (helm-do-ag--default-target (when (and (not basedir) (not helm-ag--buffer-search))
-                                           (helm-read-file-name
-                                            "Search in file(s): "
-                                            :default default-directory
-                                            :marked-candidates t :must-match t)))
-             (helm-do-ag--extensions (helm-ag--do-ag-searched-extensions))
-             (one-directory-p (helm-do-ag--is-target-one-directory-p
-                               helm-do-ag--default-target))
-             (search-string (if (region-active-p)
-                                (rxt-quote-pcre
-                                 (buffer-substring-no-properties (region-beginning) (region-end)))
-                              (thing-at-point 'symbol t))))
-        (helm-ag--set-do-ag-option)
-        (helm-ag--save-current-context)
-        (helm-attrset 'name (helm-ag--helm-header helm-ag--default-directory)
-                      helm-source-do-ag)
-        (if (or (helm-ag--windows-p) (not one-directory-p)) ;; Path argument must be specified on Windows
-            (helm :sources '(helm-source-do-ag) :buffer "*helm-ag*"
-                  :input search-string
-                  :keymap helm-do-ag-map)
-          (let* ((helm-ag--default-directory
-                  (file-name-as-directory (car helm-do-ag--default-target)))
-                 (helm-do-ag--default-target nil))
-            (helm :sources '(helm-source-do-ag) :buffer "*helm-ag*"
-                  :input search-string
-                  :keymap helm-do-ag-map)))))
+    (progn
+      (defun spacemacs//helm-do-ag-region-or-symbol (func)
+        "Perform a search with `ag' with a default input."
+        (require 'helm-ag)
+        (cl-letf* (((symbol-value 'helm-ag-insert-at-point) 'symbol)
+                   ;; make thing-at-point choosing the active region first
+                   ((symbol-function 'this-fn) (symbol-function 'thing-at-point))
+                   ((symbol-function 'thing-at-point)
+                    (lambda (thing)
+                      (if (region-active-p)
+                          (buffer-substring-no-properties
+                           (region-beginning) (region-end))
+                        (this-fn thing)))))
+          (call-interactively func)))
+
+      (defun spacemacs/helm-do-ag-region-or-symbol ()
+        "Perform a search with `ag' with a default input."
+        (interactive)
+        (spacemacs//helm-do-ag-region-or-symbol 'helm-do-ag))
+
+      (defun spacemacs/helm-do-ack ()
+        "Perform a search with ack using `helm-ag.'"
+        (interactive)
+        (if (configuration-layer/package-usedp 'helm-ag)
+            (let ((helm-ag-base-command "ack --nocolor --nogroup"))
+              (call-interactively 'helm-do-ag))
+          (message "error: helm-ag not found.")))
+
+      (defun spacemacs/helm-do-ack-region-or-symbol ()
+        "Perform a search with ack using `helm-ag.' using a default input."
+        (interactive)
+        (spacemacs//helm-do-ag-region-or-symbol 'spacemacs/helm-do-ack))
+
+      (defun spacemacs/helm-do-pt ()
+        "Perform a search with the platinum searcher using `helm-ag.'"
+        (interactive)
+        (if (configuration-layer/package-usedp 'helm-ag)
+            (let ((helm-ag-base-command "pt --nocolor --nogroup"))
+              (call-interactively 'helm-do-ag))
+          (message "error: helm-ag not found.")))
+
+      (defun spacemacs/helm-do-pt-region-or-symbol ()
+        "Perform a search with pt using `helm-ag.' using a default input."
+        (interactive)
+        (spacemacs//helm-do-ag-region-or-symbol 'spacemacs/helm-do-pt))
+
+      (evil-leader/set-key
+        "sa" 'helm-do-ag
+        "sA" 'spacemacs/helm-do-ag-region-or-symbol
+        "sk" 'spacemacs/helm-do-ack
+        "sK" 'spacemacs/helm-do-ack-region-or-symbol
+        "sp" 'spacemacs/helm-do-pt
+        "sP" 'spacemacs/helm-do-pt-region-or-symbol))
     :config
     (progn
       (evil-define-key 'normal helm-ag-map "SPC" evil-leader--default-map)

        "rr"  'helm-register
        "rm"  'helm-all-mark-rings
        "s/"  'spacemacs/helm-smart-do-search
        "sa"  'helm-do-ag
        "sA"  'spacemacs/helm-do-ag-symbol
        "sg"  'helm-do-grep
        "sG"  'spacemacs/helm-do-grep-symbol
        "sk"  'spacemacs/helm-do-ack
        "sK"  'spacemacs/helm-do-ack-symbol
        "sp"  'spacemacs/helm-do-pt
        "sP"  'spacemacs/helm-do-pt-symbol
        "sL"  'spacemacs/last-search-buffer
        "sl"  'helm-semantic-or-imenu)


            (helm-find-files-up-one-level 1)
          ad-do-it))

      (defun spacemacs/helm-do-grep-region-or-symbol ()
        "Version of `helm-do-grep' with a default input."
        (interactive)
        (require 'helm)
        (let* ((preselection (or (dired-get-filename nil t)
                                 (buffer-file-name (current-buffer))))
               (only (helm-read-file-name
                      "Search in file(s): "
                      :marked-candidates t
                      :preselect (and helm-do-grep-preselect-candidate
                                      (if helm-ff-transformer-show-only-basename
                                          (helm-basename preselection)
                                        preselection))))
               (prefarg (or current-prefix-arg helm-current-prefix-arg))
               (default-input (if (region-active-p)
                                  (buffer-substring-no-properties
                                   (region-beginning) (region-end))
                                (thing-at-point 'symbol t))))
          (helm-do-grep-1 only prefarg nil nil default-input)))

      (defun spacemacs//helm-do-search-find-tool (tools)
        "Create a cond form given a TOOLS string list and evaluate it."
