LunarVim/lua/lv-which-key/init.lua

55 lines
1.4 KiB
Lua
Raw Normal View History

-- if not package.loaded['which-key'] then
-- return
-- end
2021-07-07 02:42:29 +02:00
local status_ok, which_key = pcall(require, "which-key")
if not status_ok then
return
end
2021-07-10 03:57:55 +02:00
which_key.setup(O.plugin.which_key.setup)
2021-06-28 18:45:45 +02:00
2021-07-10 04:18:06 +02:00
local opts = O.plugin.which_key.opts
local vopts = O.plugin.which_key.vopts
2021-07-10 03:57:55 +02:00
local mappings = O.plugin.which_key.mappings
local vmappings = O.plugin.which_key.vmappings;
2021-07-10 03:34:12 +02:00
-- if O.plugin.ts_playground.active then
-- vim.api.nvim_set_keymap("n", "<leader>Th", ":TSHighlightCapturesUnderCursor<CR>", { noremap = true, silent = true })
-- mappings[""] = "Highlight Capture"
-- end
2021-07-02 18:28:16 +02:00
2021-06-30 00:55:01 +02:00
if O.plugin.zen.active then
2021-07-05 03:14:01 +02:00
vim.api.nvim_set_keymap("n", "<leader>z", ":ZenMode<CR>", { noremap = true, silent = true })
mappings["z"] = "Zen"
2021-06-30 00:55:01 +02:00
end
2021-07-10 03:01:23 +02:00
2021-07-02 03:06:07 +02:00
if O.plugin.telescope_project.active then
2021-07-05 03:14:01 +02:00
-- open projects
vim.api.nvim_set_keymap(
"n",
"<leader>P",
2021-07-05 03:14:01 +02:00
":lua require'telescope'.extensions.project.project{}<CR>",
{ noremap = true, silent = true }
)
2021-07-05 21:35:06 +02:00
mappings["P"] = "Projects"
2021-06-30 00:55:01 +02:00
end
2021-06-28 18:45:45 +02:00
2021-07-10 08:38:54 +02:00
if O.plugin.lush.active then
2021-07-05 03:14:01 +02:00
mappings["L"] = {
name = "+Lush",
l = { ":Lushify<cr>", "Lushify" },
x = { ":lua require('lush').export_to_buffer(require('lush_theme.cool_name'))", "Lush Export" },
t = { ":LushRunTutorial<cr>", "Lush Tutorial" },
q = { ":LushRunQuickstart<cr>", "Lush Quickstart" },
}
2021-07-02 18:28:16 +02:00
end
2021-07-07 03:42:26 +02:00
for k, v in pairs(O.user_which_key) do
mappings[k] = v
end
2021-07-05 03:14:01 +02:00
local wk = require "which-key"
2021-06-30 00:55:01 +02:00
wk.register(mappings, opts)
wk.register(vmappings, vopts)