From 071cd3e60289b1657ae607ccfce165e43bcdd2dc Mon Sep 17 00:00:00 2001 From: Charles Gould Date: Sun, 26 Jul 2020 16:49:03 -0400 Subject: [PATCH] git: set GIT_PAGER and GIT_SEQUENCE_EDITOR conditionally --- fish/config.fish | 8 ++++++++ git/config | 3 --- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/fish/config.fish b/fish/config.fish index 8727f8b..ce81a2a 100644 --- a/fish/config.fish +++ b/fish/config.fish @@ -7,6 +7,14 @@ if test -x /usr/libexec/java_home set -gx JAVA_HOME (/usr/libexec/java_home -v 1.8) end +if command -q diff-so-fancy + set -gx GIT_PAGER 'diff-so-fancy | less --tabs=4 -RFX' +end + +if command -q interactive-rebase-tool + set -gx GIT_SEQUENCE_EDITOR 'interactive-rebase-tool' +end + if status --is-interactive # Disable the default shell greeting set fish_greeting diff --git a/git/config b/git/config index 02bc884..0f25675 100644 --- a/git/config +++ b/git/config @@ -4,9 +4,6 @@ [core] autocrlf = input editor = nvim - pager = diff-so-fancy | less --tabs=4 -RFX -[sequence] - editor = interactive-rebase-tool [alias] aliases = config --get-regexp alias branchsort = branch --sort='-committerdate' --format='%(HEAD) %(color:blue)%(committerdate:short)%(color:reset) - %(if)%(worktreepath)%(then)%(color:reverse yellow)%(refname:short)%(color:reset)%(else)%(color:yellow)%(refname:short)%(color:reset)%(end)'