From fc76cb3f5231a9df10b06fb2f7371345335ca71f Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sat, 26 Jun 2021 08:08:12 +0530 Subject: [PATCH] global theme option --- init.lua | 5 +++-- lua/file-icons.lua | 3 ++- lua/highlights.lua | 3 ++- lua/statusline.lua | 13 ++++++++----- lua/themes/gruvbox.lua | 6 +++--- 5 files changed, 18 insertions(+), 12 deletions(-) diff --git a/init.lua b/init.lua index ce91f42..2dc2398 100644 --- a/init.lua +++ b/init.lua @@ -3,7 +3,7 @@ require "pluginList" require "misc-utils" require "top-bufferline" -require "statusline" +require "telescope-nvim" local cmd = vim.cmd local g = vim.g @@ -14,14 +14,15 @@ g.auto_save = 0 -- colorscheme related stuff cmd "syntax on" +g.nvchad_theme = "gruvbox" local base16 = require "base16" base16(base16.themes["nvchad-softgruv"], true) require "highlights" require("colorizer").setup() require "mappings" -require "telescope-nvim" require "file-icons" +require "statusline" -- hide line numbers , statusline in specific buffers! vim.api.nvim_exec( diff --git a/lua/file-icons.lua b/lua/file-icons.lua index 373eb61..3b16c21 100644 --- a/lua/file-icons.lua +++ b/lua/file-icons.lua @@ -1,4 +1,5 @@ -local colors = require "themes/gruvbox" +local global_theme = "themes/" .. vim.g.nvchad_theme +local colors = require(global_theme) require "nvim-web-devicons".setup { override = { diff --git a/lua/highlights.lua b/lua/highlights.lua index a71738a..cc5561d 100644 --- a/lua/highlights.lua +++ b/lua/highlights.lua @@ -1,6 +1,7 @@ local cmd = vim.cmd -local colors = require "themes/gruvbox" +local global_theme = "themes/"..vim.g.nvchad_theme +local colors = require(global_theme) local white = colors.white local darker_black = colors.darker_black diff --git a/lua/statusline.lua b/lua/statusline.lua index 6823e55..cbc4781 100644 --- a/lua/statusline.lua +++ b/lua/statusline.lua @@ -4,13 +4,16 @@ local condition = require("galaxyline.condition") gl.short_line_list = {" "} -local colors = require "themes/gruvbox" +local global_theme = "themes/" .. vim.g.nvchad_theme +local colors = require(global_theme) gls.left[1] = { - FirstElement = { - provider = function() return '▋' end, - highlight = { colors.nord_blue, colors.nord_blue } - }, + FirstElement = { + provider = function() + return "▋" + end, + highlight = {colors.nord_blue, colors.nord_blue} + } } gls.left[2] = { diff --git a/lua/themes/gruvbox.lua b/lua/themes/gruvbox.lua index 10e0503..48d96ab 100644 --- a/lua/themes/gruvbox.lua +++ b/lua/themes/gruvbox.lua @@ -1,9 +1,9 @@ local colors = { white = "#c7b89d", - darker_black = "#1d2021", + darker_black = "#1e2122", black = "#222526", -- nvim bg black2 = "#26292a", - one_bg = "#2a2e36", -- real bg of onedark + one_bg = "#2a2e36", one_bg2 = "#31353d", one_bg3 = "#343840", grey = "#46494a", @@ -16,7 +16,7 @@ local colors = { line = "#2c2f30", -- for lines like vertsplit green = "#89b482", vibrant_green = "#a9b665", - nord_blue = "#7b9bbb", + nord_blue = "#6f8faf", blue = "#6d8dad", yellow = "#d6b676", sun = "#d1b171",