Skip to content

Commit

Permalink
random
Browse files Browse the repository at this point in the history
  • Loading branch information
mosheavni committed Dec 28, 2023
1 parent c90288a commit 8e4d32d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
3 changes: 0 additions & 3 deletions .config/nvim/lua/plugins/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,11 @@ local M = {
require('user.menu').add_actions('Colorscheme', {
['Toggle Sonokai Style'] = function()
local styles = { 'default', 'atlantis', 'andromeda', 'shusia', 'maia', 'espresso' }
-- toggle vim.g.sonokai_style and reset the colorscheme
local current_value = vim.g.sonokai_style
local index = require('user.utils').tbl_get_next(styles, current_value)
vim.g.sonokai_style = styles[index]
vim.defer_fn(function()
vim.cmd [[colorscheme sonokai]]
P('Set sonokai_style to ' .. styles[index])
end, 100)
end,
})
end,
Expand Down
4 changes: 1 addition & 3 deletions .config/nvim/lua/user/menu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ local function add_prefix(actions, prefix)
end

M.add_actions = function(prefix, actions)
local actions_prefixed = {}
local actions_prefixed = actions
if prefix ~= nil then
actions_prefixed = add_prefix(actions, prefix)
else
actions_prefixed = actions
end
M.actions = vim.tbl_extend('force', M.actions, actions_prefixed)
end
Expand Down

0 comments on commit 8e4d32d

Please sign in to comment.