From 2db2f4c15b79e53fee2d852b83f71c7a8b4f5957 Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Thu, 13 Jan 2022 22:52:56 +0100 Subject: Move spectre mapping to whichkey --- lua/config/whichkey.lua | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) (limited to 'lua/config/whichkey.lua') diff --git a/lua/config/whichkey.lua b/lua/config/whichkey.lua index 85ef65d..d045f05 100644 --- a/lua/config/whichkey.lua +++ b/lua/config/whichkey.lua @@ -184,6 +184,46 @@ local mappings = { -- h = { "ToggleTerm size=10 direction=horizontal", "Horizontal" }, -- v = { "ToggleTerm size=80 direction=vertical", "Vertical" }, -- }, + r = { + t = { + "lua require('spectre').toggle_line()", + "toggle current item", + }, + -- ["enter_file"] = { + -- map = "", + -- cmd = "lua require('spectre.actions').select_entry()", + -- desc = "goto current file", + -- }, + Q = { + "lua require('spectre.actions').send_to_qf()", + "send all item to quickfix", + }, + c = { + "lua require('spectre.actions').replace_cmd()", + "input replace vim command", + }, + o = { + "lua require('spectre').show_options()", + "show option", + }, + R = { + cmd = "lua require('spectre.actions').run_replace()", + desc = "replace all", + }, + m = { + "lua require('spectre').change_view()", + "change result view mode", + }, + I = { + "lua require('spectre').change_options('ignore-case')", + "toggle ignore case", + }, + H = { + "lua require('spectre').change_options('hidden')", + "toggle search hidden", + }, + -- you can put your mapping here it only use normal mode + }, } local vopts = { -- cgit v1.2.3-70-g09d2