Skip to content

Commit 7de3bae

Browse files
committed
BREAK: remove default mappings
1 parent 54eaae1 commit 7de3bae

File tree

2 files changed

+8
-19
lines changed

2 files changed

+8
-19
lines changed

README.md

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ Live grep args picker for [telescope.nvim](https://github.com/nvim-telescope/tel
1818
It enables passing arguments to the grep command, `rg` examples:
1919

2020
- `foo` → press `<C-k>``"foo" ``"foo" -tmd`
21+
- Only works if you set up the `<C-k>` mapping
2122
- `--no-ignore foo`
2223
- `"foo bar" bazdir`
24+
- `"foo" --iglob **/bar/**`
2325

2426
Find the full [ripgrep guide](https://github.com/BurntSushi/ripgrep/blob/master/GUIDE.md) here to find out what is possible.
2527

@@ -70,13 +72,6 @@ Call live grep args:
7072

7173
## Usage
7274

73-
### Mappings
74-
75-
| Mappings | Action |
76-
| --- | --- |
77-
| `<C-k>` | Quote prompt, e.g. `foo``"foo" ` |
78-
79-
8075
### Grep argument examples
8176

8277
(Some examples are ripgrep specific)
@@ -86,6 +81,7 @@ Call live grep args:
8681
| `foo bar` | `foo bar` | search for „foo bar“ |
8782
| `"foo bar" baz` | `foo bar`, `baz` | search for „foo bar“ in dir „baz“ |
8883
| `--no-ignore "foo bar` | `--no-ignore`, `foo bar` | search for „foo bar“ ignoring ignores |
84+
| `"foo" --iglob **/test/**` | search for „foo“ in any „test“ path |
8985
| `"foo" ../other-project` | `foo`, `../other-project` | search for „foo“ in `../other-project` |
9086

9187
If the prompt value does not begin with `'`, `"` or `-` the entire prompt is treated as a single argument.
@@ -102,13 +98,13 @@ telescope.setup {
10298
extensions = {
10399
live_grep_args = {
104100
auto_quoting = true, -- enable/disable auto-quoting
105-
-- override default mappings
106-
-- default_mappings = {},
101+
-- define mappings, e.g.
107102
mappings = { -- extend mappings
108103
i = {
109104
["<C-k>"] = lga_actions.quote_prompt(),
110-
}
111-
}
105+
["<C-i>"] = lga_actions.quote_prompt({ postfix = " --iglob " }),
106+
},
107+
},
112108
-- ... also accepts theme settings, for example:
113109
-- theme = "dropdown", -- use dropdown theme
114110
-- theme = { }, -- use own theme spec

lua/telescope/_extensions/live_grep_args.lua

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,11 @@ end
2323

2424
local setup_opts = {
2525
auto_quoting = true,
26-
}
27-
28-
local default_mappings = {
29-
i = {
30-
["<C-k>"] = actions.quote_prompt(), -- k for kwote :D - q is already taken
31-
},
26+
mappings = {},
3227
}
3328

3429
local live_grep_args = function(opts)
3530
opts = vim.tbl_extend("force", setup_opts, opts or {})
36-
local mappings = opts.default_mappings or default_mappings
37-
opts.mappings = vim.tbl_deep_extend("force", mappings, opts.mappings or {})
3831

3932
opts.vimgrep_arguments = opts.vimgrep_arguments or conf.vimgrep_arguments
4033
opts.entry_maker = opts.entry_maker or make_entry.gen_from_vimgrep(opts)

0 commit comments

Comments
 (0)