vim: better telescope
key mappings (match fzf
)
This commit is contained in:
parent
7392fed0d5
commit
fee0d0f5c7
1 changed files with 19 additions and 10 deletions
|
@ -113,25 +113,33 @@ return {
|
||||||
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 state = require("telescope.actions.state")
|
||||||
local trouble = vim.F.npcall(require, "trouble.providers.telescope") or {}
|
|
||||||
|
local clear_prompt = function(prompt_bufnr)
|
||||||
|
state.get_current_picker(prompt_bufnr):reset_prompt()
|
||||||
|
end
|
||||||
|
|
||||||
local mappings = {
|
local mappings = {
|
||||||
["<c-u>"] = function(prompt_bufnr)
|
["<c-y>"] = layout.cycle_layout_next,
|
||||||
state.get_current_picker(prompt_bufnr):reset_prompt()
|
["<c-u>"] = clear_prompt,
|
||||||
end,
|
["<c-i>"] = actions.toggle_selection + actions.move_selection_next,
|
||||||
["<c-j>"] = actions.cycle_history_next,
|
["<c-o>"] = actions.toggle_selection + actions.move_selection_previous,
|
||||||
["<c-k>"] = actions.cycle_history_prev,
|
["<c-p>"] = layout.toggle_preview,
|
||||||
|
|
||||||
|
["<c-j>"] = actions.move_selection_next,
|
||||||
|
["<c-k>"] = actions.move_selection_previous,
|
||||||
|
|
||||||
|
["<c-f>"] = actions.results_scrolling_down,
|
||||||
|
["<c-b>"] = actions.results_scrolling_up,
|
||||||
|
|
||||||
["<s-down>"] = actions.preview_scrolling_down,
|
["<s-down>"] = actions.preview_scrolling_down,
|
||||||
["<s-up>"] = actions.preview_scrolling_up,
|
["<s-up>"] = actions.preview_scrolling_up,
|
||||||
["<c-y>"] = layout.cycle_layout_next,
|
|
||||||
["<c-o>"] = layout.toggle_mirror,
|
|
||||||
["<c-h>"] = layout.toggle_preview,
|
|
||||||
["<c-s>"] = actions.select_horizontal,
|
["<c-s>"] = actions.select_horizontal,
|
||||||
["<c-x>"] = false,
|
["<c-x>"] = false,
|
||||||
["<c-c>"] = actions.close,
|
["<c-c>"] = actions.close,
|
||||||
|
|
||||||
["<c-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
|
["<c-q>"] = actions.smart_send_to_qflist + actions.open_qflist,
|
||||||
["<c-l>"] = actions.smart_send_to_loclist + actions.open_loclist,
|
["<c-l>"] = actions.smart_send_to_loclist + actions.open_loclist,
|
||||||
["<c-b>"] = trouble.smart_open_with_trouble,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return vim.tbl_deep_extend("force", opts or {}, {
|
return vim.tbl_deep_extend("force", opts or {}, {
|
||||||
|
@ -163,6 +171,7 @@ return {
|
||||||
buffers = {
|
buffers = {
|
||||||
mappings = {
|
mappings = {
|
||||||
n = { x = actions.delete_buffer },
|
n = { x = actions.delete_buffer },
|
||||||
|
i = { ["<c-x>"] = actions.delete_buffer },
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
colorscheme = { theme = "dropdown" },
|
colorscheme = { theme = "dropdown" },
|
||||||
|
|
Loading…
Add table
Reference in a new issue