Skip to content

Instantly share code, notes, and snippets.

@hadret
Created July 5, 2023 19:36
Show Gist options
  • Save hadret/def3d312a8e0061df04d42797cb0414c to your computer and use it in GitHub Desktop.
Save hadret/def3d312a8e0061df04d42797cb0414c to your computer and use it in GitHub Desktop.
Go-Dark, Go-Light
# setup OS
local os="$(uname)"
case $os in
Darwin)
# iTerm2 auto-Darkmode
local val=$(defaults read -g AppleInterfaceStyle 2>/dev/null)
if test ! -n "$val"; then
export ITERM_PROFILE="Default"
else
export ITERM_PROFILE="Dark"
fi
godark() {
dark-mode on
exec zsh
}
golight() {
dark-mode off
exec zsh
}
;;
esac
# Colors setup
case $ITERM_PROFILE in
Default)
local color00='#ffffff'
local color01='#e0e0e0'
local color02='#d6d6d6'
local color03='#8e908c'
local color04='#969896'
local color05='#4d4d4c'
local color06='#282a2e'
local color07='#1d1f21'
local color08='#c82829'
local color09='#f5871f'
local color0A='#eab700'
local color0B='#718c00'
local color0C='#3e999f'
local color0D='#4271ae'
local color0E='#8959a8'
local color0F='#a3685a'
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=$color03"
ZSH_HIGHLIGHT_STYLES[alias]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[assign]="fg=$color0B"
ZSH_HIGHLIGHT_STYLES[comment]="fg=$color03"
ZSH_HIGHLIGHT_STYLES[suffix-alias]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[global-alias]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[function]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[builtin]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[reserved-word]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[hashed-command]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[command]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[commandseparator]="fg=$color0A"
ZSH_HIGHLIGHT_STYLES[default]="fg=$color0D"
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]="fg=$color0D"
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]="fg=$color0B"
ZSH_HIGHLIGHT_STYLES[double-quoted-argument-unclosed]="fg=$color08"
ZSH_HIGHLIGHT_STYLES[path]="fg=$color0D,underline"
ZSH_HIGHLIGHT_STYLES[precommand]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[redirection]="fg=$color0C"
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]="fg=$color0D"
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]="fg=$color0B"
ZSH_HIGHLIGHT_STYLES[single-quoted-argument-unclosed]="fg=$color08"
export BAT_THEME="ansi"
export DELTA_THEME="light"
export HIGHLIGHT_STYLE="base16/tomorrow"
export FZF_DEFAULT_OPTS="
--height 75%
--reverse
--color=bg+:$color01,bg:$color00,spinner:$color0C,hl:$color0D
--color=fg:$color04,header:$color0D,info:$color0A,pointer:$color0C
--color=marker:$color0C,fg+:$color06,prompt:$color0A,hl+:$color0D"
;;
Dark)
local color00='#000000'
local color01='#282a2e'
local color02='#373b41'
local color03='#969896'
local color04='#b4b7b4'
local color05='#c5c8c6'
local color06='#e0e0e0'
local color07='#ffffff'
local color08='#cc6666'
local color09='#de935f'
local color0A='#f0c674'
local color0B='#b5bd68'
local color0C='#8abeb7'
local color0D='#81a2be'
local color0E='#b294bb'
local color0F='#a3685a'
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE="fg=$color03"
ZSH_HIGHLIGHT_STYLES[alias]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[assign]="fg=$color0B"
ZSH_HIGHLIGHT_STYLES[comment]="fg=$color03"
ZSH_HIGHLIGHT_STYLES[suffix-alias]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[global-alias]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[function]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[builtin]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[reserved-word]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[hashed-command]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[command]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[commandseparator]="fg=$color0A"
ZSH_HIGHLIGHT_STYLES[default]="fg=$color0D"
ZSH_HIGHLIGHT_STYLES[double-hyphen-option]="fg=$color0D"
ZSH_HIGHLIGHT_STYLES[double-quoted-argument]="fg=$color0B"
ZSH_HIGHLIGHT_STYLES[double-quoted-argument-unclosed]="fg=$color08"
ZSH_HIGHLIGHT_STYLES[path]="fg=$color0D,underline"
ZSH_HIGHLIGHT_STYLES[precommand]="fg=$color0E"
ZSH_HIGHLIGHT_STYLES[redirection]="fg=$color0C"
ZSH_HIGHLIGHT_STYLES[single-hyphen-option]="fg=$color0D"
ZSH_HIGHLIGHT_STYLES[single-quoted-argument]="fg=$color0B"
ZSH_HIGHLIGHT_STYLES[single-quoted-argument-unclosed]="fg=$color08"
export BAT_THEME="ansi"
export DELTA_THEME="dark"
export HIGHLIGHT_STYLE="base16/tomorrow-night"
export FZF_DEFAULT_OPTS="
--height 75%
--reverse
--color=bg+:$color01,bg:$color00,spinner:$color0C,hl:$color0D
--color=fg:$color04,header:$color0D,info:$color0A,pointer:$color0C
--color=marker:$color0C,fg+:$color06,prompt:$color0A,hl+:$color0D"
;;
esac
return {
{ "hadret/all-blue.nvim" }, -- Tiny little theme for lualine
{
"nvim-lualine/lualine.nvim", -- Fancy status line
event = "VeryLazy",
opts = {
options = {
theme = "all_blue",
section_separators = "",
component_separators = "",
globalstatus = true,
},
extensions = { "neo-tree", "lazy" },
},
config = function(_, opts)
require("lualine").setup(opts)
end,
},
{
"olimorris/onedarkpro.nvim", -- Nice theme with good light and dark mode
priority = 1000,
config = function()
require("onedarkpro").setup({
colors = {
onelight = {
bg = "#FFFFFF",
},
},
styles = {
types = "NONE",
methods = "NONE",
numbers = "NONE",
strings = "NONE",
comments = "italic",
keywords = "bold,italic",
constants = "NONE",
functions = "italic",
operators = "NONE",
variables = "NONE",
parameters = "NONE",
conditionals = "italic",
virtual_text = "NONE",
},
})
-- Sync background color with ITERM_PROFILE
if vim.env.ITERM_PROFILE == "" then
vim.o.background = "dark"
vim.cmd("colorscheme onedark_dark")
elseif vim.env.ITERM_PROFILE == "Dark" then
vim.o.background = "dark"
vim.cmd("colorscheme onedark_dark")
elseif vim.env.ITERM_PROFILE == "Default" then
vim.o.background = "light"
vim.cmd("colorscheme onelight")
else
vim.o.background = "light"
vim.cmd("colorscheme onelight")
end
end,
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment