diff --git a/after/plugin/colors.lua b/after/plugin/colors.lua index 8b16cc13..f66eafb8 100644 --- a/after/plugin/colors.lua +++ b/after/plugin/colors.lua @@ -12,4 +12,4 @@ end ColorMyPencils() --- vim.cmd [[ ThematicRandom ]] +vim.cmd 'autocmd BufEnter * ThematicRandom' diff --git a/lua/custom/plugins/lazy.lua b/lua/custom/plugins/lazy.lua deleted file mode 100644 index f032bea4..00000000 --- a/lua/custom/plugins/lazy.lua +++ /dev/null @@ -1,7 +0,0 @@ -local lazy = require('lazy') - -lazy.setup({ - timeout = 300 -}) - -return {} \ No newline at end of file diff --git a/lua/custom/plugins/themes/vim-thematic.lua b/lua/custom/plugins/themes/vim-thematic.lua index b4286662..fca93bc4 100644 --- a/lua/custom/plugins/themes/vim-thematic.lua +++ b/lua/custom/plugins/themes/vim-thematic.lua @@ -163,5 +163,22 @@ let g:thematic#defaults = { let g:thematic#theme_name = 'catppuccin' ]] + + -- Retrieve all mappings + local mappings = vim.api.nvim_get_keymap '' + + -- Iterate through the mappings to find and remove any existing ones for the commands + for _, mapping in ipairs(mappings) do + if mapping.cmd == 'ThematicRandom' or mapping.cmd == 'ThematicCatppuccino' then + -- Remove existing mappings + vim.api.nvim_del_keymap(mapping.mode, mapping.lhs) + end + end + + -- Set new mapping for ThematicRandom + vim.api.nvim_set_keymap('n', 'tr', ':ThematicRandom', { silent = true }) + + -- Set new mapping for ThematicCatppuccino + vim.api.nvim_set_keymap('n', 'tc', ':Thematic catppuccin', { silent = true }) end, }