From cc48bfb5c8cebc3d1367dd8e5cfbdf8213c4a5b5 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Fri, 24 Sep 2021 18:57:36 +0530 Subject: [PATCH] remove cheatsheet.nvim --- lua/core/default_config.lua | 6 ---- lua/core/mappings.lua | 13 +-------- lua/plugins/configs/cheatsheet.lua | 44 ------------------------------ lua/plugins/init.lua | 11 -------- 4 files changed, 1 insertion(+), 73 deletions(-) delete mode 100644 lua/plugins/configs/cheatsheet.lua diff --git a/lua/core/default_config.lua b/lua/core/default_config.lua index 4fa4a76..f3f192d 100644 --- a/lua/core/default_config.lua +++ b/lua/core/default_config.lua @@ -61,7 +61,6 @@ M.plugins = { autosave = false, -- to autosave files blankline = true, -- show code scope with symbols bufferline = true, -- list open buffers up the top, easy switching too - cheatsheet = true, -- search your commands/keymappings colorizer = true, -- color RGB, HEX, CSS, NAME color codes comment = true, -- easily (un)comment code, language aware dashboard = false, -- NeoVim 'home screen' on open @@ -153,11 +152,6 @@ M.mappings.plugins = { next_buffer = "", -- next buffer prev_buffer = "", -- previous buffer }, - -- search your commands/keymappings - cheatsheet = { - default_keys = "dk", - user_keys = "uk", - }, -- easily (un)comment code, language aware comment = { toggle = "/", -- toggle comment (works on multiple lines) diff --git a/lua/core/mappings.lua b/lua/core/mappings.lua index 3299925..15f29ae 100644 --- a/lua/core/mappings.lua +++ b/lua/core/mappings.lua @@ -62,7 +62,7 @@ M.misc = function() map("n", wnav.moveRight, "l") map("n", wnav.moveUp, "k") map("n", wnav.moveDown, "j") - end + end -- check the theme toggler if nvChad_options.theme_toggler then @@ -128,17 +128,6 @@ M.bufferline = function() map("n", m.prev_buffer, ":BufferLineCyclePrev ") 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 - M.comment = function() local m = plugin_maps.comment.toggle map("n", m, ":CommentToggle ") diff --git a/lua/plugins/configs/cheatsheet.lua b/lua/plugins/configs/cheatsheet.lua deleted file mode 100644 index 39d0b1f..0000000 --- a/lua/plugins/configs/cheatsheet.lua +++ /dev/null @@ -1,44 +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 == "plugin" then - for sec, key in pairs(mappings.plugin) 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 5363c96..d7d9cfc 100644 --- a/lua/plugins/init.lua +++ b/lua/plugins/init.lua @@ -263,18 +263,7 @@ return packer.startup(function() use { "nvim-telescope/telescope.nvim", cmd = "Telescope", - -- because cheatsheet is not activated by a teleacope command - module = "cheatsheet", requires = { - { - "sudormrfbin/cheatsheet.nvim", - disable = not plugin_status.cheatsheet, - after = "telescope.nvim", - config = override_req("cheatsheet", "plugins.configs.cheatsheet"), - setup = function() - require("core.mappings").cheatsheet() - end, - }, { "nvim-telescope/telescope-fzf-native.nvim", run = "make",