fix: export global variables for omf (#116)

This commit is contained in:
Wenxuan Zhang 2020-10-14 11:46:15 +08:00
parent 18edc577a0
commit 2d950aa2c4
No known key found for this signature in database
GPG key ID: CCAF35548C65530F

View file

@ -12,18 +12,18 @@ function forgit::inside_work_tree
git rev-parse --is-inside-work-tree >/dev/null;
end
set forgit_pager "$FORGIT_PAGER"
set forgit_show_pager "$FORGIT_SHOW_PAGER"
set forgit_diff_pager "$FORGIT_DIFF_PAGER"
set forgit_ignore_pager "$FORGIT_IGNORE_PAGER"
set -g forgit_pager "$FORGIT_PAGER"
set -g forgit_show_pager "$FORGIT_SHOW_PAGER"
set -g forgit_diff_pager "$FORGIT_DIFF_PAGER"
set -g forgit_ignore_pager "$FORGIT_IGNORE_PAGER"
test -z "$forgit_pager"; and set forgit_pager (git config core.pager || echo 'cat')
test -z "$forgit_show_pager"; and set forgit_show_pager (git config pager.show || echo "$forgit_pager")
test -z "$forgit_diff_pager"; and set forgit_diff_pager (git config pager.diff || echo "$forgit_pager")
test -z "$forgit_ignore_pager"; and set forgit_ignore_pager (type -q bat >/dev/null 2>&1 && echo 'bat -l gitignore --color=always' || echo 'cat')
test -z "$forgit_pager"; and set -g forgit_pager (git config core.pager || echo 'cat')
test -z "$forgit_show_pager"; and set -g forgit_show_pager (git config pager.show || echo "$forgit_pager")
test -z "$forgit_diff_pager"; and set -g forgit_diff_pager (git config pager.diff || echo "$forgit_pager")
test -z "$forgit_ignore_pager"; and set -g forgit_ignore_pager (type -q bat >/dev/null 2>&1 && echo 'bat -l gitignore --color=always' || echo 'cat')
# https://github.com/wfxr/emoji-cli
type -q emojify >/dev/null 2>&1 && set forgit_emojify '|emojify'
type -q emojify >/dev/null 2>&1 && set -g forgit_emojify '|emojify'
# git commit viewer
function forgit::log -d "git commit viewer"
@ -224,19 +224,19 @@ end
# git ignore generator
if test -z "$FORGIT_GI_REPO_REMOTE"
set -x FORGIT_GI_REPO_REMOTE https://github.com/dvcs/gitignore
set -g FORGIT_GI_REPO_REMOTE https://github.com/dvcs/gitignore
end
if test -z "$FORGIT_GI_REPO_LOCAL"
if test "XDG_CACHE_HOME"
set -x FORGIT_GI_REPO_LOCAL $XDG_CACHE_HOME/forgit/gi/repos/dvcs/gitignore
set -g FORGIT_GI_REPO_LOCAL $XDG_CACHE_HOME/forgit/gi/repos/dvcs/gitignore
else
set -x FORGIT_GI_REPO_LOCAL $HOME/.cache/forgit/gi/repos/dvcs/gitignore
set -g FORGIT_GI_REPO_LOCAL $HOME/.cache/forgit/gi/repos/dvcs/gitignore
end
end
if test -z "$FORGIT_GI_TEMPLATES"
set -x FORGIT_GI_TEMPLATES $FORGIT_GI_REPO_LOCAL/templates
set -g FORGIT_GI_TEMPLATES $FORGIT_GI_REPO_LOCAL/templates
end
function forgit::ignore -d "git ignore generator"
@ -297,7 +297,7 @@ function forgit::ignore::clean
[[ -d "$FORGIT_GI_REPO_LOCAL" ]] && rm -rf "$FORGIT_GI_REPO_LOCAL"
end
set FORGIT_FZF_DEFAULT_OPTS "
set -g FORGIT_FZF_DEFAULT_OPTS "
$FZF_DEFAULT_OPTS
--ansi
--height='80%'