summaryrefslogtreecommitdiff
path: root/lua/telescope/pickers.lua
diff options
context:
space:
mode:
authorTJ DeVries <devries.timothyj@gmail.com>2020-09-03 11:18:08 -0400
committerTJ DeVries <devries.timothyj@gmail.com>2020-09-03 11:18:08 -0400
commitb04ec331c48a1668b0df21f24e9870acccec5e64 (patch)
tree081aa2548142bb52db2baa339f6c7e8e0cac68f3 /lua/telescope/pickers.lua
parentd48a2933d55a5aa2ca3c15e482a90bbffbb49b92 (diff)
feat: Add cool mapping for <C-R> in command mode
Diffstat (limited to 'lua/telescope/pickers.lua')
-rw-r--r--lua/telescope/pickers.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/lua/telescope/pickers.lua b/lua/telescope/pickers.lua
index db46e20..b072f90 100644
--- a/lua/telescope/pickers.lua
+++ b/lua/telescope/pickers.lua
@@ -64,6 +64,7 @@ function Picker:new(opts)
return setmetatable({
prompt = opts.prompt,
+ default_text = opts.default_text,
finder = opts.finder,
sorter = opts.sorter,
@@ -384,7 +385,11 @@ function Picker:find()
mappings.apply_keymap(prompt_bufnr, self.attach_mappings, default_mappings)
- vim.cmd [[startinsert]]
+ if self.default_text then
+ vim.api.nvim_buf_set_lines(prompt_bufnr, 0, 1, false, {self.default_text})
+ end
+
+ vim.cmd [[startinsert!]]
end
function Picker:hide_preview()