add mapping cheatsheet (#244)
This commit is contained in:
parent
eaaefc236d
commit
c62e94923a
|
@ -51,6 +51,7 @@ local M = {
|
|||
nvim_comment = true,
|
||||
neoscroll_nvim = true,
|
||||
telescope_media = true,
|
||||
cheatsheet = false,
|
||||
},
|
||||
-- make sure you dont use same keys twice
|
||||
mappings = {
|
||||
|
@ -88,6 +89,10 @@ local M = {
|
|||
telescope_media = {
|
||||
media_files = "<leader>fp",
|
||||
},
|
||||
chadsheet = {
|
||||
default_keys = "<leader>dk",
|
||||
user_keys = "<leader>uk",
|
||||
},
|
||||
bufferline = {
|
||||
new_buffer = "<S-t>",
|
||||
newtab = "<C-t>b",
|
||||
|
|
|
@ -114,6 +114,18 @@ M.telescope_media = function()
|
|||
map("n", m.media_files, ":Telescope media_files <CR>", opt)
|
||||
end
|
||||
|
||||
M.chadsheet = function()
|
||||
local m = user_map.chadsheet
|
||||
|
||||
map("n", m.default_keys, ":lua require('cheatsheet').show_cheatsheet_telescope()<CR>", opt)
|
||||
map(
|
||||
"n",
|
||||
m.user_keys,
|
||||
":lua require('cheatsheet').show_cheatsheet_telescope{bundled_cheatsheets = false, bundled_plugin_cheatsheets = false }<CR>",
|
||||
opt
|
||||
)
|
||||
end
|
||||
|
||||
M.bufferline = function()
|
||||
local m = user_map.bufferline
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ return packer.startup(function()
|
|||
|
||||
use {
|
||||
"nvim-telescope/telescope.nvim",
|
||||
cmd = "Telescope",
|
||||
after = "plenary.nvim",
|
||||
requires = {
|
||||
{
|
||||
"nvim-telescope/telescope-fzf-native.nvim",
|
||||
|
@ -182,6 +182,17 @@ return packer.startup(function()
|
|||
require("mappings").telescope_media()
|
||||
end,
|
||||
},
|
||||
{
|
||||
"sudormrfbin/cheatsheet.nvim",
|
||||
disable = not plugin_status.cheatsheet,
|
||||
after = "telescope.nvim",
|
||||
config = function()
|
||||
require "plugins.chadsheet"
|
||||
end,
|
||||
setup = function()
|
||||
require("mappings").chadsheet()
|
||||
end,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require "plugins.telescope"
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
local present, chadsheet = pcall(require, "cheatsheet")
|
||||
|
||||
if not present then
|
||||
return
|
||||
end
|
||||
|
||||
local mappings = require("chadrc").mappings
|
||||
|
||||
-- add user mappings to the cheetsheet
|
||||
for section, data in pairs(mappings) do
|
||||
for description, keymap in pairs(data) do
|
||||
chadsheet.add_cheat(description, keymap, section)
|
||||
end
|
||||
end
|
||||
|
||||
require("cheatsheet").setup {
|
||||
|
||||
bundled_cheatsheets = {
|
||||
enabled = { "default" },
|
||||
disabled = { "unicode", "nerd-fonts" },
|
||||
},
|
||||
|
||||
bundled_plugin_cheatsheets = false,
|
||||
include_only_installed_plugins = true,
|
||||
}
|
Loading…
Reference in New Issue