aboutsummaryrefslogtreecommitdiff
path: root/lua/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'lua/plugins')
-rw-r--r--lua/plugins/telescope.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua
index 9ed43ca..f6f7558 100644
--- a/lua/plugins/telescope.lua
+++ b/lua/plugins/telescope.lua
@@ -130,7 +130,13 @@ require('telescope').setup({
['<PageUp>'] = actions.results_scrolling_up,
['<PageDown>'] = actions.results_scrolling_down,
-
+ ['cd'] = function(prompt_bufnr)
+ local selection = require('telescope.actions.state').get_selected_entry()
+ local dir = vim.fn.fnamemodify(selection.path, ':p:h')
+ require('telescope.actions').close(prompt_bufnr)
+ -- Depending on what you want put `cd`, `lcd`, `tcd`
+ vim.cmd(string.format('silent lcd %s', dir))
+ end,
['?'] = actions.which_key,
--["<C-o>"] = function(prompt_bufnr)
-- local selection = require("telescope.actions.state").get_selected_entry()