parent
1567a9c73a
commit
aa9667a5de
|
@ -66,7 +66,6 @@ M.plugins = {
|
||||||
bufferline = true, -- manage and preview opened buffers
|
bufferline = true, -- manage and preview opened buffers
|
||||||
colorizer = false, -- color RGB, HEX, CSS, NAME color codes
|
colorizer = false, -- color RGB, HEX, CSS, NAME color codes
|
||||||
comment = true, -- easily (un)comment code, language aware
|
comment = true, -- easily (un)comment code, language aware
|
||||||
cheatsheet = true,
|
|
||||||
dashboard = false,
|
dashboard = false,
|
||||||
esc_insertmode = true, -- map to <ESC> with no lag
|
esc_insertmode = true, -- map to <ESC> with no lag
|
||||||
feline = true, -- statusline
|
feline = true, -- statusline
|
||||||
|
@ -172,12 +171,6 @@ M.mappings.plugins = {
|
||||||
next_buffer = "<TAB>",
|
next_buffer = "<TAB>",
|
||||||
prev_buffer = "<S-Tab>",
|
prev_buffer = "<S-Tab>",
|
||||||
},
|
},
|
||||||
|
|
||||||
cheatsheet = {
|
|
||||||
default_keys = "<leader>dk",
|
|
||||||
user_keys = "<leader>uk",
|
|
||||||
},
|
|
||||||
|
|
||||||
comment = {
|
comment = {
|
||||||
toggle = "<leader>/",
|
toggle = "<leader>/",
|
||||||
},
|
},
|
||||||
|
|
|
@ -169,15 +169,4 @@ M.telescope_media = function()
|
||||||
map("n", m.media_files, ":Telescope media_files <CR>")
|
map("n", m.media_files, ":Telescope media_files <CR>")
|
||||||
end
|
end
|
||||||
|
|
||||||
M.cheatsheet = function()
|
|
||||||
local m = plugin_maps.cheatsheet
|
|
||||||
|
|
||||||
map("n", m.default_keys, ":lua require('cheatsheet').show_cheatsheet_telescope() <CR>")
|
|
||||||
map(
|
|
||||||
"n",
|
|
||||||
m.user_keys,
|
|
||||||
":lua require('cheatsheet').show_cheatsheet_telescope{bundled_cheatsheets = false, bundled_plugin_cheatsheets = false } <CR>"
|
|
||||||
)
|
|
||||||
end
|
|
||||||
|
|
||||||
return M
|
return M
|
||||||
|
|
|
@ -1,45 +0,0 @@
|
||||||
local present, cheatsheet = pcall(require, "cheatsheet")
|
|
||||||
|
|
||||||
if not present then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
local mappings = require("core.utils").load_config().mappings
|
|
||||||
|
|
||||||
-- add user mappings to the cheetsheet
|
|
||||||
-- improve this function to not hardcode plugin
|
|
||||||
local function add_to_cheatsheet(section, keymap, desc)
|
|
||||||
if section == "plugins" then
|
|
||||||
for sec, key in pairs(mappings.plugins) do
|
|
||||||
add_to_cheatsheet(sec, key, sec)
|
|
||||||
end
|
|
||||||
|
|
||||||
else
|
|
||||||
if type(keymap) == "table" then
|
|
||||||
for sec, key in pairs(keymap) do
|
|
||||||
if type(sec) == "number" then
|
|
||||||
add_to_cheatsheet(section, key, desc or section)
|
|
||||||
else
|
|
||||||
add_to_cheatsheet(sec, key, desc or section)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
else
|
|
||||||
cheatsheet.add_cheat(section, keymap, desc or "Misc")
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
for section, keymap in pairs(mappings) do
|
|
||||||
add_to_cheatsheet(section, keymap)
|
|
||||||
end
|
|
||||||
|
|
||||||
require("cheatsheet").setup {
|
|
||||||
|
|
||||||
bundled_cheatsheets = {
|
|
||||||
enabled = { "default" },
|
|
||||||
disabled = { "unicode", "nerd-fonts" },
|
|
||||||
},
|
|
||||||
|
|
||||||
bundled_plugin_cheatsheets = false,
|
|
||||||
include_only_installed_plugins = true,
|
|
||||||
}
|
|
|
@ -234,18 +234,6 @@ return packer.startup(function()
|
||||||
require("core.mappings").telescope()
|
require("core.mappings").telescope()
|
||||||
end,
|
end,
|
||||||
}
|
}
|
||||||
|
-- load user defined plugins
|
||||||
use {
|
|
||||||
"sudormrfbin/cheatsheet.nvim",
|
|
||||||
disable = not plugin_settings.status.cheatsheet,
|
|
||||||
module = "cheatsheet",
|
|
||||||
config = function()
|
|
||||||
require "plugins.configs.cheatsheet"
|
|
||||||
end,
|
|
||||||
setup = function()
|
|
||||||
require("core.mappings").cheatsheet()
|
|
||||||
end,
|
|
||||||
}
|
|
||||||
|
|
||||||
require("core.hooks").run("install_plugins", use)
|
require("core.hooks").run("install_plugins", use)
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue