mirror of
https://github.com/LazyVim/LazyVim.git
synced 2025-06-24 17:58:51 +02:00
feat(flash): telescope integration. Use s
in normal and <c-s>
in insert mode
This commit is contained in:
parent
1acad8be93
commit
12b57235a9
1 changed files with 30 additions and 0 deletions
|
@ -33,4 +33,34 @@ return {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"nvim-telescope/telescope.nvim",
|
||||||
|
optional = true,
|
||||||
|
opts = function(_, opts)
|
||||||
|
local function flash(prompt_bufnr)
|
||||||
|
require("flash").jump({
|
||||||
|
pattern = "^",
|
||||||
|
highlight = { label = { after = { 0, 0 } } },
|
||||||
|
search = {
|
||||||
|
mode = "search",
|
||||||
|
exclude = {
|
||||||
|
function(win)
|
||||||
|
return vim.bo[vim.api.nvim_win_get_buf(win)].filetype ~= "TelescopeResults"
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
action = function(match)
|
||||||
|
local picker = require("telescope.actions.state").get_current_picker(prompt_bufnr)
|
||||||
|
picker:set_selection(match.pos[1] - 1)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
opts.defaults = vim.tbl_deep_extend("force", opts.defaults, {
|
||||||
|
mappings = {
|
||||||
|
n = { s = flash },
|
||||||
|
i = { ["<c-s>"] = flash },
|
||||||
|
},
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue