From aa9667a5de855c271eab255e87d3d0b40d337235 Mon Sep 17 00:00:00 2001 From: siduck Date: Mon, 15 Nov 2021 22:51:51 +0530 Subject: [PATCH] Revert "add cheatsheet.nvim" This reverts commit e8b919723e57beb1aa8d9886dfd2447c3d925968. --- lua/colors/highlights.lua | 2 +- lua/core/default_config.lua | 7 ----- lua/core/mappings.lua | 11 -------- lua/plugins/configs/cheatsheet.lua | 45 ------------------------------ lua/plugins/init.lua | 14 +--------- 5 files changed, 2 insertions(+), 77 deletions(-) delete mode 100644 lua/plugins/configs/cheatsheet.lua diff --git a/lua/colors/highlights.lua b/lua/colors/highlights.lua index 46823d2..895a929 100644 --- a/lua/colors/highlights.lua +++ b/lua/colors/highlights.lua @@ -137,7 +137,7 @@ if ui.transparency then bg("NvimTreeStatusLineNC", "NONE") bg("NvimTreeVertSplit", "NONE") fg("NvimTreeVertSplit", grey) -end + end if #override ~= 0 then require(override) diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index c7c3ba8..6c73a9d 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -66,7 +66,6 @@ M.plugins = { bufferline = true, -- manage and preview opened buffers colorizer = false, -- color RGB, HEX, CSS, NAME color codes comment = true, -- easily (un)comment code, language aware - cheatsheet = true, dashboard = false, esc_insertmode = true, -- map to with no lag feline = true, -- statusline @@ -172,12 +171,6 @@ M.mappings.plugins = { next_buffer = "", prev_buffer = "", }, - - cheatsheet = { - default_keys = "dk", - user_keys = "uk", - }, - comment = { toggle = "/", }, diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index 37a1a73..3e0162b 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -169,15 +169,4 @@ M.telescope_media = function() map("n", m.media_files, ":Telescope media_files ") end -M.cheatsheet = function() - local m = plugin_maps.cheatsheet - - map("n", m.default_keys, ":lua require('cheatsheet').show_cheatsheet_telescope() ") - map( - "n", - m.user_keys, - ":lua require('cheatsheet').show_cheatsheet_telescope{bundled_cheatsheets = false, bundled_plugin_cheatsheets = false } " - ) -end - return M diff --git a/lua/plugins/configs/cheatsheet.lua b/lua/plugins/configs/cheatsheet.lua deleted file mode 100644 index aece17c..0000000 --- a/lua/plugins/configs/cheatsheet.lua +++ /dev/null @@ -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, -} diff --git a/lua/plugins/init.lua b/lua/plugins/init.lua index 6825cf0..39a3c14 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -234,18 +234,6 @@ return packer.startup(function() require("core.mappings").telescope() end, } - - 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, - } - + -- load user defined plugins require("core.hooks").run("install_plugins", use) end)