Skip to content

Instantly share code, notes, and snippets.

@johnnyutahh
Last active June 9, 2023 14:55
Show Gist options
  • Save johnnyutahh/d6310eb416e846601ba4e86a9abd164e to your computer and use it in GitHub Desktop.
Save johnnyutahh/d6310eb416e846601ba4e86a9abd164e to your computer and use it in GitHub Desktop.
diff-so-fancy macOS light-vs-dark mode configuration management, 2023-06-09
$ pwd
/Users/XXXXXXXXXXXX/.config/git
$
$ diff gitconfig-diff-so-fancy-light-mode gitconfig-diff-so-fancy-dark-mode
13,14c13,14
< oldNormal = black
< newNormal = black
---
> oldNormal = white
> newNormal = white
$ cat !$
cat gitconfig-diff-so-fancy-dark-mode
#
# diff-so-fancy related settings
#
# added 2023-03-22. ~Johnny
#
# https://github.com/so-fancy/diff-so-fancy
#
[color "diff-highlight"]
# make non-different portions of lines
# _not_ color-highlighted, for macOS Light Mode:
# https://github.com/so-fancy/diff-so-fancy/issues/464#issuecomment-1481423068
# ~Johnny, 2023-03-24
oldNormal = white
newNormal = white
$ date
Fri Jun 9 09:47:32 CDT 2023
$ sw_vers
ProductName: macOS
ProductVersion: 12.6.5
BuildVersion: 21G531
$
$ cd ~/gitrs/diff-so-fancy/
$
$ git remote show origin | grep URL
Fetch URL: https://github.com/so-fancy/diff-so-fancy
Push URL: https://github.com/so-fancy/diff-so-fancy
$ git rev-parse HEAD
d7dcc1715f5bffc575183c16a2f458caa37cfa1b
$
$ type light-mode
light-mode is a function
light-mode ()
{
light-mode-git-diff-so-fancy;
vim-light-or-dark-mode 'white'
}
$ type dark-mode
dark-mode is a function
dark-mode ()
{
dark-mode-git-diff-so-fancy;
vim-light-or-dark-mode 'black'
}
$ type dark-mode-git-diff-so-fancy
dark-mode-git-diff-so-fancy is a function
dark-mode-git-diff-so-fancy ()
{
diff-so-fancy-light-or-dark-mode--core 'dark'
}
$ type diff-so-fancy-light-or-dark-mode--core
diff-so-fancy-light-or-dark-mode--core is a function
diff-so-fancy-light-or-dark-mode--core ()
{
light_or_dark="$1";
original_dir=`pwd`;
cd $HOME/.config/git;
ln -sf gitconfig-diff-so-fancy-"${light_or_dark}"-mode gitconfig-diff-so-fancy-dark-or-light-mode;
cd $original_dir
}
$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment