-
-
Notifications
You must be signed in to change notification settings - Fork 390
Locate
helm-locate
(<helm-prefix> l
by default) is Helm’s interface to the locate command, which finds files on your system that have been indexed with updatedb.
The exact command for helm-locate
can be customized through the variable helm-locate-command
. The default value works on most locate
versions and variants.
On more recent versions of locate
, you may want to use multi-matching with the --regex
option, which is not available in older versions:
(setq helm-locate-command "locate %s -e -A --regex %s")
Execute the helm-locate
command, then enter a filename or pattern at the prompt. Some options are below:
Option | Description |
---|---|
-b | Only use the base name (no directories) |
-e | Only include files that actually exist |
-n | Limit number of search results |
Example pattern:
emacs -b -e -n 12
In helm-find-files
, hit C-x C-f
. With a prefix argument, you can choose a locatedb
file.
When the search is done, you can search in a specific file or directory with the grep
action in the action menu (TAB). You can also launch Helm grep
with (C-u) M-g s
without switching to the action panel.
You can specify a locate
database with prefix argument ARG (C-u
). Many databases can be used: navigate to and mark them. See helm-locate-with-db
.
To create a user specific db, use:
updatedb -l 0 -o dbpath -U directory
where dbpath
is a filename matched by helm-locate-db-file-regexp
.
On Windows, you should use the Everything, which works like locate
. It is very fast and does not require manual database updates.
To use Everything
with helm-locate
, you will need the command line tool named es
. Be sure to modify the PATH
environment variable to include path to the directory that contain es
. Also unset helm-locate-fuzzy-match
, or Everything
will give no results.
To use mdfind
, disable helm-locate-fuzzy-match
. If it is set to `t` and mdfind
is used, helm-locate
won’t show any results.