summaryrefslogtreecommitdiff
path: root/lua/lv-which-key/init.lua
diff options
context:
space:
mode:
authorCam Spiers <[email protected]>2021-07-03 06:18:57 +1200
committerGitHub <[email protected]>2021-07-02 14:18:57 -0400
commitc1c4e63e5b7cb75f71c137bfd39ae44cd85e537b (patch)
treea55f936a30ef7c673eff180ad9f0e985e9afa7fb /lua/lv-which-key/init.lua
parent3d01da8a506ae2663dd17589478a7ef8d9bf0c45 (diff)
Add snap as an optional alternative to telescope (#582)
Co-authored-by: Cam Spiers <[email protected]>
Diffstat (limited to 'lua/lv-which-key/init.lua')
-rw-r--r--lua/lv-which-key/init.lua19
1 files changed, 12 insertions, 7 deletions
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', '<Leader>e',
-- ":NvimTreeToggle<CR>",
-- {noremap = true, silent = true})
--- telescope
-vim.api.nvim_set_keymap('n', '<Leader>f', ':Telescope find_files<CR>',
- {noremap = true, silent = true})
+-- telescope or snap
+if O.plugin.snap.active then
+ vim.api.nvim_set_keymap('n', '<Leader>f', ':Snap find_files<CR>',
+ {noremap = true, silent = true})
+else
+ vim.api.nvim_set_keymap('n', '<Leader>f', ':Telescope find_files<CR>',
+ {noremap = true, silent = true})
+end
-- dashboard
vim.api.nvim_set_keymap('n', '<Leader>;', ':Dashboard<CR>',
@@ -98,7 +103,7 @@ local mappings = {
b = {
name = "Buffers",
j = {"<cmd>BufferPick<cr>", "jump to buffer"},
- f = {"<cmd>Telescope buffers<cr>", "Find buffer"},
+ f = {O.plugin.snap.active and "<cmd>Snap buffers<cr>" or "<cmd>Telescope buffers<cr>", "Find buffer"},
w = {"<cmd>BufferWipeout<cr>", "wipeout buffer"},
e = {
"<cmd>BufferCloseAllButCurrent<cr>", "close all but current buffer"
@@ -226,13 +231,13 @@ local mappings = {
-- "<cmd>Telescope lsp_workspace_diagnostics<cr>",
-- "Workspace Diagnostics"
-- },
- f = {"<cmd>Telescope find_files<cr>", "Find File"},
+ f = {O.plugin.snap.active and "<cmd>Snap find_files<cr>" or "<cmd>Telescope find_files<cr>", "Find File"},
h = {"<cmd>Telescope help_tags<cr>", "Find Help"},
-- m = {"<cmd>Telescope marks<cr>", "Marks"},
M = {"<cmd>Telescope man_pages<cr>", "Man Pages"},
- r = {"<cmd>Telescope oldfiles<cr>", "Open Recent File"},
+ r = {O.plugin.snap.active and "<cmd>Snap oldfiles<cr>" or "<cmd>Telescope oldfiles<cr>", "Open Recent File"},
R = {"<cmd>Telescope registers<cr>", "Registers"},
- t = {"<cmd>Telescope live_grep<cr>", "Text"}
+ t = {O.plugin.snap.active and "<cmd>Snap live_grep<cr>" or "<cmd>Telescope live_grep<cr>", "Text"}
},
S = {
name = "Session",