SPC / and
SPC s p (
spacemacs/helm-project-smart-do-search) enables a a fuzzy logic search through the content of all the files in the current project. A helm pop-up displays, typing a pattern shows matching lines from all the files in the project.
C-k to move down and up through the search results.
RET selects the search result and shows the file and line in the current buffer.
Search tool binary
Searching requires an external tool to be available on your system PATH. Ripgrep is the recommended search tool, although silver searcher (ag) is a viable alternative. Using
grep is noticeably slower and has fewer options for searching.
Searching specific files
Include or exclude specific files by their names or filename extensions.
-g option for a filename to search (globbing), or
-g! for a filename to ignore.
-g*.clj map shows only results of searching for
map from files ending in
-g!*.md map will search for
map for all files except those ending in
Example search patterns
Additional search patterns that work with
-G*.cljs -w time - search for the word "time" in all
-tclojure time - search for "time" in all
uno\ due\ tre - search for the string "uno duo tre"
-C5 foo - search for "foo" but show 5 lines of context before and after the match
(?:^|[^\w-])time(?:[^\w-]|$) - search for "time" even in kebab-case words. i.e. search for the full word "time" including "-" to be a word character
Ripgrep documentation has many regular expression examples