git: set GIT_PAGER and GIT_SEQUENCE_EDITOR conditionally

This commit is contained in:
Charles Gould 2020-07-26 16:49:03 -04:00
parent 32c85f0c3f
commit 071cd3e602
2 changed files with 8 additions and 3 deletions

View File

@ -7,6 +7,14 @@ if test -x /usr/libexec/java_home
set -gx JAVA_HOME (/usr/libexec/java_home -v 1.8) set -gx JAVA_HOME (/usr/libexec/java_home -v 1.8)
end 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 if status --is-interactive
# Disable the default shell greeting # Disable the default shell greeting
set fish_greeting set fish_greeting

View File

@ -4,9 +4,6 @@
[core] [core]
autocrlf = input autocrlf = input
editor = nvim editor = nvim
pager = diff-so-fancy | less --tabs=4 -RFX
[sequence]
editor = interactive-rebase-tool
[alias] [alias]
aliases = config --get-regexp 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)' 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)'