-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to configure this plugin? #9
Comments
@ghillb funny thing, I was just migrating from TLDR: One is to simply pass the new command in the option
You can also create a function for it, and you can custom whatever you want, for example, you can set default values just like that: local M = {}
function M.custom_live_grep_raw (opts)
local defaults = {
vimgrep_arguments = { 'rg', '--hidden'}
}
opts = vim.tbl_extend("force", defaults, opts or {})
require('telescope').extensions.live_grep_raw.live_grep_raw(opts)
end
return M And then you could call it by running something like:
As any other picker, you can also customize even more, like adding function M.live_grep_raw(opts)
local defaults = {
vimgrep_arguments = vim.split(M.vimgrep_arguments, ' '),
path_display = M.my_custom_path_display,
theme = 'dropdown',
}
opts = vim.tbl_extend("force", defaults, opts or {})
opts = require("telescope.themes")["get_" .. opts.theme](opts) -- Apply theme
require("telescope").extensions.live_grep_raw.live_grep_raw(opts)
end I also started a fork changing the plugin to make it possible to configure it through the common extension setup recipe. Soon I'll create a PR for this: telescope.setup{
extensions = {
live_grep_raw = {
vimgrep_arguments = {...}
}
}
}
telescope.load_extension('live_grep_raw') BR |
Here is the PR #10 |
@alefpereira
and the the config with your branch:
|
I see, this behavior also happens with {
"rg",
"--color=never",
"--no-heading",
"--with-filename",
"--line-number",
"--column",
"--smart-case"
} You can check
I'll include this detail about |
live_grep_args now supports the |
Currently there doesn't seem to be a way to pass default parameters. For example one has to always type
--hidden
when searching in dotfiles. Also the rg flag-.
(short for--hidden
) does not work.It would be nice, if this plugin could inherit the
vim_grep_arguments
setting from the default telescopelive_grep
function.The text was updated successfully, but these errors were encountered: