vim: clear telescope prompt with <c-u>

This commit is contained in:
Fernando Schauenburg 2024-02-23 23:46:47 +01:00
parent fe084ae46a
commit c39be0a592

View file

@ -112,9 +112,13 @@ return {
opts = function(_, opts) opts = function(_, opts)
local actions = require("telescope.actions") local actions = require("telescope.actions")
local layout = require("telescope.actions.layout") local layout = require("telescope.actions.layout")
local state = require("telescope.actions.state")
local trouble = vim.F.npcall(require, "trouble.providers.telescope") or {} local trouble = vim.F.npcall(require, "trouble.providers.telescope") or {}
local mappings = { local mappings = {
["<c-u>"] = function(prompt_bufnr)
state.get_current_picker(prompt_bufnr):reset_prompt()
end,
["<c-j>"] = actions.cycle_history_next, ["<c-j>"] = actions.cycle_history_next,
["<c-k>"] = actions.cycle_history_prev, ["<c-k>"] = actions.cycle_history_prev,
["<s-down>"] = actions.preview_scrolling_down, ["<s-down>"] = actions.preview_scrolling_down,