feat: Add cool mapping for <C-R> in command mode

This commit is contained in:
TJ DeVries
2020-09-03 11:18:08 -04:00
parent d48a2933d5
commit b04ec331c4
3 changed files with 14 additions and 4 deletions

View File

@@ -11,9 +11,7 @@ local finders = {}
-- JobFinder(my_job_args)
---@class Finder
local Finder = {
hello = "world"
}
local Finder = {}
Finder.__index = Finder
Finder.__call = function(t, ... ) return t:_find(...) end

View File

@@ -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()