                      tools)
            (t 'helm-do-grep))))
 
-      (defun spacemacs//get-search-tools (defaultp)
-        "Return a list of search tools.
-Return `dotspacemacs-search-tools' or just a list of default tools when
-DEFAULTP is non-nil."
-        (if defaultp
-            (delq nil (mapcar (lambda (x)
-                                (and (not (member x '("ag" "pt"))) x))
-                              dotspacemacs-search-tools))
-          dotspacemacs-search-tools))
-
       ;; Search in current file ----------------------------------------------
 
       (defun spacemacs/helm-file-do-ag-region-or-symbol ()

        (interactive)
        (spacemacs//helm-do-ag-region-or-symbol 'spacemacs/helm-buffers-do-pt))

      (defun spacemacs/helm-buffers-smart-do-search
          (&optional arg default-inputp)
        "Search in opened buffers using `dotspacemacs-search-tools'.
Search for a search tool in the order provided by `dotspacemacs-search-tools'
If ARG is non nil then `ag' and `pt' and ignored.
If DEFAULT-INPUTP is non nil then the current region or symbol at point
are used as default input."
        (interactive "P")
        (call-interactively
         (spacemacs//helm-do-search-find-tool "helm-buffers-do"
                                              (spacemacs//get-search-tools arg)
                                              default-inputp)))

      (defun spacemacs/helm-buffers-smart-do-search-region-or-symbol
          (&optional arg)
        "Search in opened buffers using `dotspacemacs-search-tools' with
default input.
Search for a search tool in the order provided by `dotspacemacs-search-tools'
If ARG is non nil then `ag' and `pt' and ignored."
        (interactive "P")
        (spacemacs/helm-buffers-smart-do-search arg t))

      ;; Search in project ---------------------------------------------------


               (kbd "q") 'quit-window)

      (evil-leader/set-key
        ;; opened buffers scope
        "sb"  'spacemacs/helm-buffers-smart-do-search
        "sB"  'spacemacs/helm-buffers-smart-do-search-region-or-symbol
