https://github.com/gexplorer/ag-popup
The power of searching with ag with transient popups Magit style.
https://github.com/gexplorer/ag-popup
emacs emacs-package search
Last synced: 10 days ago
JSON representation
The power of searching with ag with transient popups Magit style.
- Host: GitHub
- URL: https://github.com/gexplorer/ag-popup
- Owner: gexplorer
- License: gpl-3.0
- Created: 2020-12-01T12:14:22.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-14T15:51:44.000Z (over 5 years ago)
- Last Synced: 2025-10-28T00:25:50.437Z (9 months ago)
- Topics: emacs, emacs-package, search
- Language: Emacs Lisp
- Homepage:
- Size: 122 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ag-popup
The power of searching with [ag](https://github.com/ggreer/the_silver_searcher) with transient popups [Magit](https://github.com/magit/magit) style.
# Usage
This package provides a transient popup to configure the arguments of [ag](https://github.com/ggreer/the_silver_searcher) but it **does not** perform the search, instead it relies in the variable **ag-popup-function** to do it.
## Using counsel
If [ivy](https://github.com/abo-abo/swiper) is your completion mechanism of choice, and you use the great [counsel](https://github.com/abo-abo/swiper#counsel) package you can improve `counsel-ag` with:
```elisp
(defun ag-popup-counsel (directory args)
"Search using `counsel-ag' in DIRECTORY with ARGS."
(counsel-ag "" directory (mapconcat 'identity args " ")))
(setq ag-popup-function #'ag-popup-counsel)
```
## Using ag.el
If you want to use [ag.el](https://github.com/Wilfred/ag.el) to do your searching, you can easily improve it with:
```elisp
(defun ag-popup-ag (directory args)
"Search using `ag' in DIRECTORY with ARGS."
(let ((string (read-from-minibuffer "Search string: "))
(ag-arguments (append ag-arguments args)))
(ag/search string directory)))
(setq ag-popup-function #'ag-popup-ag)
```
# Preview
