            "\\(?:\\`[#.]\\)"
            ;; file names ending with # or ~
            "\\|\\(?:\\`.+?[#~]\\'\\)"))
+    (ivy-set-actions
+     'counsel-find-file
+     `(("x"
+        (lambda (x) (delete-file (expand-file-name x ivy--directory)))
+        ,(propertize "delete" 'face 'font-lock-warning-face))))
 
+    ;; counsel-ag
     ;; Redefine `counsel-ag-base-command' with my required options, especially
     ;; the `--follow' option to allow search through symbolic links.
     (setq counsel-ag-base-command

      (bind-key "C-c C-q" #'counsel-org-tag-agenda org-agenda-mode-map)))
  :config
  (progn
    (setq counsel-find-file-at-point t)
    (setq counsel-find-file-ignore-regexp
          (concat

                             '("--noheading" ; no file names above matching content
                               "--nocolor"
                               "%S"))
                     " "))))


(provide 'setup-counsel)
