-
-
Notifications
You must be signed in to change notification settings - Fork 815
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
Is there any options for change the searching directory when the command cd
is used?
#2964
Comments
What do you mean Telescope sets the |
@jamestrew I have the following mapping: vim.keymap.set("n", "<leader>cc", ":exec 'cd' . expand('%:p:h')<CR>", { noremap = true, silent = true }) According to your comment, the |
cwd
is used?cd
is used?
I'm not able to reproduce your claim with this minimal config local root = vim.fn.fnamemodify("./.repro", ":p")
-- set stdpaths to use .repro
for _, name in ipairs({ "config", "data", "state", "cache" }) do
vim.env[("XDG_%s_HOME"):format(name:upper())] = root .. "/" .. name
end
-- bootstrap lazy
local lazypath = root .. "/plugins/lazy.nvim"
if not vim.loop.fs_stat(lazypath) then
vim.fn.system({
"git",
"clone",
"--filter=blob:none",
"https://github.com/folke/lazy.nvim.git",
lazypath,
})
end
vim.opt.runtimepath:prepend(lazypath)
-- install plugins
local plugins = {
{
"nvim-telescope/telescope.nvim",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-tree/nvim-web-devicons",
},
config = function()
require("telescope").setup({})
end,
},
}
require("lazy").setup(plugins, {
root = root .. "/plugins",
})
vim.keymap.set("n", "<leader>cc", ":exec 'cd' . expand('%:p:h')<CR>", { noremap = true, silent = true }) telescope-cd-repo.mp4I opened a file in a subdirectory and used your Can you try with this minimal config? |
Closing due to lack of response. |
Is your feature request related to a problem? Please describe.
I use
cd
command but telescope still searches in the directory I opened up.Describe the solution you'd like
I need telescope to change the base searching directory after changing the directory by
cd
(and confirmed bypwd
).Describe alternatives you've considered
I've just found the option
cwd
for thefind_files
andgrep
, but it's tedious to modify this option for all the possible functionalities.The text was updated successfully, but these errors were encountered: