From c1c4e63e5b7cb75f71c137bfd39ae44cd85e537b Mon Sep 17 00:00:00 2001 From: Cam Spiers Date: Sat, 3 Jul 2021 06:18:57 +1200 Subject: Add snap as an optional alternative to telescope (#582) Co-authored-by: Cam Spiers --- lua/lv-which-key/init.lua | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'lua/lv-which-key/init.lua') diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index 02d99ec8..3af04edf 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -68,9 +68,14 @@ vim.api.nvim_set_keymap('n', 'e', -- ":NvimTreeToggle", -- {noremap = true, silent = true}) --- telescope -vim.api.nvim_set_keymap('n', 'f', ':Telescope find_files', - {noremap = true, silent = true}) +-- telescope or snap +if O.plugin.snap.active then + vim.api.nvim_set_keymap('n', 'f', ':Snap find_files', + {noremap = true, silent = true}) +else + vim.api.nvim_set_keymap('n', 'f', ':Telescope find_files', + {noremap = true, silent = true}) +end -- dashboard vim.api.nvim_set_keymap('n', ';', ':Dashboard', @@ -98,7 +103,7 @@ local mappings = { b = { name = "Buffers", j = {"BufferPick", "jump to buffer"}, - f = {"Telescope buffers", "Find buffer"}, + f = {O.plugin.snap.active and "Snap buffers" or "Telescope buffers", "Find buffer"}, w = {"BufferWipeout", "wipeout buffer"}, e = { "BufferCloseAllButCurrent", "close all but current buffer" @@ -226,13 +231,13 @@ local mappings = { -- "Telescope lsp_workspace_diagnostics", -- "Workspace Diagnostics" -- }, - f = {"Telescope find_files", "Find File"}, + f = {O.plugin.snap.active and "Snap find_files" or "Telescope find_files", "Find File"}, h = {"Telescope help_tags", "Find Help"}, -- m = {"Telescope marks", "Marks"}, M = {"Telescope man_pages", "Man Pages"}, - r = {"Telescope oldfiles", "Open Recent File"}, + r = {O.plugin.snap.active and "Snap oldfiles" or "Telescope oldfiles", "Open Recent File"}, R = {"Telescope registers", "Registers"}, - t = {"Telescope live_grep", "Text"} + t = {O.plugin.snap.active and "Snap live_grep" or "Telescope live_grep", "Text"} }, S = { name = "Session", -- cgit v1.2.3