File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
lua/telescope/_extensions Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,12 @@ Call live grep args:
7272
7373## Usage
7474
75+ ### Options
76+
77+ | Name | Description |
78+ | --- | --- |
79+ | ` search_dirs ` | Directory/directories/files to search. Paths are expanded and appended to the grep command. |
80+
7581### Grep argument examples
7682
7783(Some examples are ripgrep specific)
Original file line number Diff line number Diff line change @@ -33,6 +33,12 @@ local live_grep_args = function(opts)
3333 opts .entry_maker = opts .entry_maker or make_entry .gen_from_vimgrep (opts )
3434 opts .cwd = opts .cwd and vim .fn .expand (opts .cwd )
3535
36+ if opts .search_dirs then
37+ for i , path in ipairs (opts .search_dirs ) do
38+ opts .search_dirs [i ] = vim .fn .expand (path )
39+ end
40+ end
41+
3642 local cmd_generator = function (prompt )
3743 if not prompt or prompt == " " then
3844 return nil
@@ -41,7 +47,7 @@ local live_grep_args = function(opts)
4147 local args = tbl_clone (opts .vimgrep_arguments )
4248 local prompt_parts = prompt_parser .parse (prompt , opts .auto_quoting )
4349
44- local cmd = vim .tbl_flatten { args , prompt_parts }
50+ local cmd = vim .tbl_flatten { args , prompt_parts , opts . search_dirs }
4551 return cmd
4652 end
4753
You can’t perform that action at this time.
0 commit comments