mirror of
https://github.com/ksyasuda/dotfiles.git
synced 2025-12-05 02:53:38 -08:00
update nvim
This commit is contained in:
@@ -3,6 +3,30 @@ local telescopeConfig = require("telescope.config")
|
||||
|
||||
local M = {}
|
||||
|
||||
function M.find_and_paste_image()
|
||||
local telescope = require("telescope.builtin")
|
||||
local actions = require("telescope.actions")
|
||||
local action_state = require("telescope.actions.state")
|
||||
|
||||
telescope.find_files({
|
||||
attach_mappings = function(_, map)
|
||||
local function embed_image(prompt_bufnr)
|
||||
local entry = action_state.get_selected_entry()
|
||||
local filepath = entry[1]
|
||||
actions.close(prompt_bufnr)
|
||||
|
||||
local img_clip = require("img-clip")
|
||||
img_clip.paste_image(nil, filepath)
|
||||
end
|
||||
|
||||
map("i", "<CR>", embed_image)
|
||||
map("n", "<CR>", embed_image)
|
||||
|
||||
return true
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
function M.setup()
|
||||
-- Clone the default Telescope configuration
|
||||
local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) }
|
||||
|
||||
Reference in New Issue
Block a user