feat: add theme toggle btn | update theme plugin path

This commit is contained in:
siduck 2022-05-06 20:14:57 +05:30
parent 0601876ab6
commit b9a1038acd
5 changed files with 27 additions and 5 deletions

View file

@ -20,7 +20,8 @@ M.options = {
M.ui = {
hl_override = {},
changed_themes = {},
colors = "", -- path of your file that contains colors
colors = {}, -- dynamically generated, never edit this in chadrc
theme_toggle = { "onedark", "one_light" },
theme = "onedark", -- default theme
transparency = false,
}

View file

@ -4,6 +4,7 @@ local g = vim.g
-- use filetype.lua instead of filetype.vim
g.did_load_filetypes = 0
g.do_filetype_lua = 1
g.toggle_theme_icon = ""
opt.confirm = true
opt.laststatus = 3 -- global statusline

View file

@ -4,13 +4,23 @@ if not present then
return
end
vim.cmd [[
function! Toggle_theme(a,b,c,d)
lua require('base46').toggle_theme()
endfunction
function! Quit_vim(a,b,c,d)
qa
endfunction
]]
local options = {
options = {
offsets = { { filetype = "NvimTree", text = "", padding = 1 } },
buffer_close_icon = "",
modified_icon = "",
close_icon = "",
show_close_icon = true,
show_close_icon = false,
left_trunc_marker = "",
right_trunc_marker = "",
max_name_length = 14,
@ -24,6 +34,16 @@ local options = {
always_show_bufferline = true,
diagnostics = false,
themable = true,
custom_areas = {
right = function()
return {
{ text = "%@Toggle_theme@" .. vim.g.toggle_theme_icon .. "%X" },
{ text = "%@Quit_vim@  %X" },
}
end,
},
custom_filter = function(buf_number)
-- Func to filter out our managed/persistent split terms
local present_type, type = pcall(function()

View file

@ -4,7 +4,7 @@ if not present then
return
end
local colors = require("base16").get_colors "base_30"
local colors = require("base46").get_colors "base_30"
local lsp = require "feline.providers.lsp"
local lsp_severity = vim.diagnostic.severity

View file

@ -18,10 +18,10 @@ local plugins = {
["NvChad/base46"] = {
after = "packer.nvim",
config = function()
local ok, base16 = pcall(require, "base16")
local ok, base46 = pcall(require, "base46")
if ok then
base16.load_theme()
base46.load_theme()
end
end,
},