|
80 | 80 |
|
81 | 81 | ### Required
|
82 | 82 |
|
83 |
| -* [`fd`][] to find the repositories on the filesystem |
| 83 | +* [`fd`][] to find the repositories on the filesystem with `list` |
| 84 | +* [`plocate`][] or [`locate`][] to find the repositories on the filesystem with `cached_list` |
84 | 85 |
|
85 | 86 | [`fd`]: https://github.com/sharkdp/fd
|
| 87 | +[`locate`]: https://man.archlinux.org/man/locate.1 |
| 88 | +[`plocate`]: https://man.archlinux.org/man/plocate.1 |
86 | 89 |
|
87 | 90 | ### Optional
|
88 | 91 |
|
@@ -173,9 +176,52 @@ Here is how you can use this plugin with various SCM:
|
173 | 176 |
|
174 | 177 | Is your favorite SCM missing? It should be straightforward to support it by changing the pattern parameter. If you want it to be considered for addition here, open a PR!
|
175 | 178 |
|
| 179 | +### cached_list |
| 180 | + |
| 181 | +`:Telescope repo cached_list` |
| 182 | + |
| 183 | +This relies on a `locate` command to find repositories. This should be much faster than the `list` command, as it relies on a pre-built index but results may be stalled. |
| 184 | + |
| 185 | +*Note*: at this point, the plugin does not manage index update. Updating the index often requires to run a command like `updatedb` as root. |
| 186 | + |
| 187 | +#### Troubleshooting |
| 188 | + |
| 189 | +You should try to run: |
| 190 | +``` |
| 191 | +sudo updatedb |
| 192 | +``` |
| 193 | +if you encounter any problems. If it’s not the case by default, you should automate such index update with for instance `cron` or `systemd-timers`. See https://wiki.archlinux.org/title/Locate. |
| 194 | + |
| 195 | +#### Options |
| 196 | + |
| 197 | +Options are the similar to `repo list`, bearing in mind that we use `locate` instead of `fd`. Note that: |
| 198 | + |
| 199 | +* `fd_opts` is not supported, as we don’t use `fd` |
| 200 | + |
| 201 | +#### Examples |
| 202 | + |
| 203 | +##### Exclude Irrelevant Results |
| 204 | + |
| 205 | +Chances are you will get results from folders you don’t care about like `.cache` or `.cargo`. In that case, you can use the `file_ignore_patterns` option of Telescope, like so (these are lua regexes): |
| 206 | + |
| 207 | +``` |
| 208 | +:lua require'telescope'.extensions.repo.cached_list{file_ignore_patterns={'.cache/', '.cargo/'}} |
| 209 | +``` |
| 210 | + |
| 211 | +##### Use With Other SCMs |
| 212 | + |
| 213 | +Here is how you can use this plugin with various SCM (we match on the whole path with `locate`, so patterns differ slightly from `repo list`: notice the `^` that becomes a `/`): |
| 214 | + |
| 215 | +| SCM | Command | |
| 216 | +|--------|----------------------------------------------------------------------------| |
| 217 | +| git | `:Telescope repo list` or `lua require'telescope'.extensions.repo.list{}` | |
| 218 | +| pijul | `lua require'telescope'.extensions.repo.list{pattern=[[/\.pijul$]]}` | |
| 219 | +| hg | `lua require'telescope'.extensions.repo.list{pattern=[[/\.hg$]]}` | |
| 220 | +| fossil | `lua require'telescope'.extensions.repo.list{pattern=[[/\.fslckout$]]}` | |
| 221 | + |
176 | 222 | ## FAQ
|
177 | 223 |
|
178 | 224 | ### Getting the repository list is slow
|
179 | 225 |
|
180 |
| -You can use your `.fdignore` to exclude some folders from your filesystem. If there is enough interest, [#1](https://github.com/cljoly/telescope-repo.nvim/issues/1) could further enhance this. |
| 226 | +If `:Telescope repo list` is slow, you can use your `.fdignore` to exclude some folders from your filesystem. If there is enough interest, [#1](https://github.com/cljoly/telescope-repo.nvim/issues/1) could further enhance this. |
181 | 227 |
|
0 commit comments