From f805cb1cbdc147ddc2484600306a615121ceb788 Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 14 Aug 2021 13:00:01 +0530 Subject: [PATCH] user_config : add option to disable telescope media plugin --- lua/chadrc.lua | 30 +++++++++++++++++++----------- lua/mappings.lua | 8 +++++--- lua/pluginList.lua | 6 +++++- 3 files changed, 29 insertions(+), 15 deletions(-) diff --git a/lua/chadrc.lua b/lua/chadrc.lua index 53d5c22..b04c9b9 100644 --- a/lua/chadrc.lua +++ b/lua/chadrc.lua @@ -1,7 +1,8 @@ local M = { ui = { theme = "onedark", - hidden_statusline = { -- these are filetypes, not pattern matched + hidden_statusline = { + -- these are filetypes, not pattern matched "NvimTree", "toggleterm" } @@ -26,22 +27,27 @@ local M = { }, -- enable / disable plugins (true for disable) plugin_status = { - better_esc = false, + -- UI nvim_bufferline = false, galaxyline = false, nvim_colorizer = false, + dashboard_nvim = false, + blankline = false, + truezen_nvim = false, + better_esc = false, + -- lsp stuff lspkind = false, lspsignature = false, - neoformat = false, + -- git stuff gitsigns = false, - vim_matchup = false, - dashboard_nvim = false, - autosave_nvim = false, - truezen_nvim = false, - blankline = false, vim_fugitive = false, + -- misc + neoformat = false, + vim_matchup = false, + autosave_nvim = false, nvim_comment = false, - neoscroll_nvim = false + neoscroll_nvim = false, + telescope_media = false }, -- make sure you dont use same keys twice mappings = { @@ -71,12 +77,14 @@ local M = { git_status = "gt", git_commits = "cm", find_files = "ff", - media_files = "fp", buffers = "fb", help_tags = "fh", oldfiles = "fo", themes = "th" }, + telescope_media = { + media_files = "fp" + }, bufferline = { new_buffer = "", newtab = "b", @@ -93,7 +101,7 @@ local M = { toggleterm = { toggle_window = "w", toggle_right = "v", - toggle_bot = "h", + toggle_bot = "h" }, misc = { esc_Termmode = "jk", diff --git a/lua/mappings.lua b/lua/mappings.lua index 81b58db..d32cdac 100644 --- a/lua/mappings.lua +++ b/lua/mappings.lua @@ -35,7 +35,6 @@ map("", "k", 'v:count ? "k" : "gk"', {expr = true}) map("", "", 'v:count ? "j" : "gj"', {expr = true}) map("", "", 'v:count ? "k" : "gk"', {expr = true}) - -- copy whole file content map("n", miscMap.copywhole_file, ":%y+", opt) @@ -46,7 +45,6 @@ map("n", miscMap.toggle_linenr, ":set nu!", opt) -- get out of terminal with jk map("t", miscMap.esc_Termmode, "", opt) - M.toggleterm = function() local m = user_map.toggleterm @@ -105,13 +103,17 @@ M.telescope = function() map("n", m.git_status, ":Telescope git_status ", opt) map("n", m.git_commits, ":Telescope git_commits ", opt) map("n", m.find_files, ":Telescope find_files ", opt) - map("n", m.media_files, ":Telescope media_files ", opt) map("n", m.buffers, ":Telescope buffers", opt) map("n", m.help_tags, ":Telescope help_tags", opt) map("n", m.oldfiles, ":Telescope oldfiles", opt) map("n", m.themes, ":Telescope themes", opt) end +M.telescope_media = function() + local m = user_map.telescope_media + map("n", m.media_files, ":Telescope media_files ", opt) +end + M.bufferline = function() local m = user_map.bufferline diff --git a/lua/pluginList.lua b/lua/pluginList.lua index 458fb0e..c31cf5a 100644 --- a/lua/pluginList.lua +++ b/lua/pluginList.lua @@ -177,7 +177,11 @@ return packer.startup( run = "make" }, { - "nvim-telescope/telescope-media-files.nvim" + "nvim-telescope/telescope-media-files.nvim", + disable = plugin_status.telescope_media, + setup = function() + require "mappings".telescope_media() + end } }, config = function()