user_config : add option to disable telescope media plugin

This commit is contained in:
siduck76 2021-08-14 13:00:01 +05:30
parent 91c8736146
commit f805cb1cbd
3 changed files with 29 additions and 15 deletions

View File

@ -1,7 +1,8 @@
local M = { local M = {
ui = { ui = {
theme = "onedark", theme = "onedark",
hidden_statusline = { -- these are filetypes, not pattern matched hidden_statusline = {
-- these are filetypes, not pattern matched
"NvimTree", "NvimTree",
"toggleterm" "toggleterm"
} }
@ -26,22 +27,27 @@ local M = {
}, },
-- enable / disable plugins (true for disable) -- enable / disable plugins (true for disable)
plugin_status = { plugin_status = {
better_esc = false, -- UI
nvim_bufferline = false, nvim_bufferline = false,
galaxyline = false, galaxyline = false,
nvim_colorizer = false, nvim_colorizer = false,
dashboard_nvim = false,
blankline = false,
truezen_nvim = false,
better_esc = false,
-- lsp stuff
lspkind = false, lspkind = false,
lspsignature = false, lspsignature = false,
neoformat = false, -- git stuff
gitsigns = false, gitsigns = false,
vim_matchup = false,
dashboard_nvim = false,
autosave_nvim = false,
truezen_nvim = false,
blankline = false,
vim_fugitive = false, vim_fugitive = false,
-- misc
neoformat = false,
vim_matchup = false,
autosave_nvim = false,
nvim_comment = false, nvim_comment = false,
neoscroll_nvim = false neoscroll_nvim = false,
telescope_media = false
}, },
-- make sure you dont use same keys twice -- make sure you dont use same keys twice
mappings = { mappings = {
@ -71,12 +77,14 @@ local M = {
git_status = "<leader>gt", git_status = "<leader>gt",
git_commits = "<leader>cm", git_commits = "<leader>cm",
find_files = "<leader>ff", find_files = "<leader>ff",
media_files = "<leader>fp",
buffers = "<leader>fb", buffers = "<leader>fb",
help_tags = "<leader>fh", help_tags = "<leader>fh",
oldfiles = "<leader>fo", oldfiles = "<leader>fo",
themes = "<leader>th" themes = "<leader>th"
}, },
telescope_media = {
media_files = "<leader>fp"
},
bufferline = { bufferline = {
new_buffer = "<S-t>", new_buffer = "<S-t>",
newtab = "<C-t>b", newtab = "<C-t>b",
@ -93,7 +101,7 @@ local M = {
toggleterm = { toggleterm = {
toggle_window = "<leader>w", toggle_window = "<leader>w",
toggle_right = "<leader>v", toggle_right = "<leader>v",
toggle_bot = "<leader>h", toggle_bot = "<leader>h"
}, },
misc = { misc = {
esc_Termmode = "jk", esc_Termmode = "jk",

View File

@ -35,7 +35,6 @@ map("", "k", 'v:count ? "k" : "gk"', {expr = true})
map("", "<Down>", 'v:count ? "j" : "gj"', {expr = true}) map("", "<Down>", 'v:count ? "j" : "gj"', {expr = true})
map("", "<Up>", 'v:count ? "k" : "gk"', {expr = true}) map("", "<Up>", 'v:count ? "k" : "gk"', {expr = true})
-- copy whole file content -- copy whole file content
map("n", miscMap.copywhole_file, ":%y+<CR>", opt) map("n", miscMap.copywhole_file, ":%y+<CR>", opt)
@ -46,7 +45,6 @@ map("n", miscMap.toggle_linenr, ":set nu!<CR>", opt)
-- get out of terminal with jk -- get out of terminal with jk
map("t", miscMap.esc_Termmode, "<C-\\><C-n>", opt) map("t", miscMap.esc_Termmode, "<C-\\><C-n>", opt)
M.toggleterm = function() M.toggleterm = function()
local m = user_map.toggleterm local m = user_map.toggleterm
@ -105,13 +103,17 @@ M.telescope = function()
map("n", m.git_status, ":Telescope git_status <CR>", opt) map("n", m.git_status, ":Telescope git_status <CR>", opt)
map("n", m.git_commits, ":Telescope git_commits <CR>", opt) map("n", m.git_commits, ":Telescope git_commits <CR>", opt)
map("n", m.find_files, ":Telescope find_files <CR>", opt) map("n", m.find_files, ":Telescope find_files <CR>", opt)
map("n", m.media_files, ":Telescope media_files <CR>", opt)
map("n", m.buffers, ":Telescope buffers<CR>", opt) map("n", m.buffers, ":Telescope buffers<CR>", opt)
map("n", m.help_tags, ":Telescope help_tags<CR>", opt) map("n", m.help_tags, ":Telescope help_tags<CR>", opt)
map("n", m.oldfiles, ":Telescope oldfiles<CR>", opt) map("n", m.oldfiles, ":Telescope oldfiles<CR>", opt)
map("n", m.themes, ":Telescope themes<CR>", opt) map("n", m.themes, ":Telescope themes<CR>", opt)
end end
M.telescope_media = function()
local m = user_map.telescope_media
map("n", m.media_files, ":Telescope media_files <CR>", opt)
end
M.bufferline = function() M.bufferline = function()
local m = user_map.bufferline local m = user_map.bufferline

View File

@ -177,7 +177,11 @@ return packer.startup(
run = "make" 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() config = function()