-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathload-configs.sh
87 lines (65 loc) · 2.27 KB
/
load-configs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/usr/bin/env bash
# -- Configuring FZF UI: --
if [ -z "$GF_VERTICAL_THRESHOLD" ]; then
export GF_VERTICAL_THRESHOLD="2.0"
fi
if [ -z "$GF_VERTICAL_PREVIEW_LOCATION" ]; then
export GF_VERTICAL_PREVIEW_LOCATION="bottom"
fi
if [ -z "$GF_HORIZONTAL_PREVIEW_LOCATION" ]; then
export GF_HORIZONTAL_PREVIEW_LOCATION="right"
fi
if [ -z "$GF_HORIZONTAL_PREVIEW_PERCENT_CALCULATION" ]; then
export GF_HORIZONTAL_PREVIEW_PERCENT_CALCULATION='max(50, min(80, 100 - ((7000 + (11 * __WIDTH__)) / __WIDTH__)))'
fi
if [ -z "$GF_HORIZONTAL_SMALL_SCREEN_CALCULATION" ]; then
export GF_HORIZONTAL_SMALL_SCREEN_CALCULATION='__HEIGHT__ <= 30'
fi
if [ -z "$GF_VERTICAL_PREVIEW_PERCENT_CALCULATION" ]; then
export GF_VERTICAL_PREVIEW_PERCENT_CALCULATION='max(50, min(80, 100 - ((4000 + (5 * __HEIGHT__)) / __HEIGHT__)))'
fi
if [ -z "$GF_VERTICAL_SMALL_SCREEN_CALCULATION" ]; then
export GF_VERTICAL_SMALL_SCREEN_CALCULATION='__HEIGHT__ <= 60'
fi
# -- Configuring External Command Style: --
# NB: used for highlighting search terms in diff output
if [ -n "$GF_GREP_COLOR" ]; then
# NB: needs exporting as `grep` runs as a subprocess
export GREP_COLOR="$GF_GREP_COLOR"
fi
if [ -n "$GF_BAT_STYLE" ]; then
# NB: needs exporting as `bat` runs as a subprocess
export BAT_STYLE="$GF_BAT_STYLE"
fi
if [ -n "$GF_BAT_THEME" ]; then
# NB: needs exporting as `bat` runs as a subprocess
export BAT_THEME="$GF_BAT_THEME"
fi
# -- Configuring `$EDITOR`: --
if [ -z "$GF_EDITOR_ARGS" ]; then
export GF_EDITOR_ARGS=''
fi
# -- Configuring `git`: --
if [ -z "$GF_DIFF_SEARCH_DEFAULTS" ]; then
export GF_DIFF_SEARCH_DEFAULTS="-G"
fi
if [ -z "$GF_HUB_PR_FORMAT" ]; then
export GF_HUB_PR_FORMAT='%pC%>(8)%I%Creset %t% l%n'
fi
if [ -z "$GF_LOG_MENU_PARAMS" ]; then
export GF_LOG_MENU_PARAMS='--pretty=oneline --abbrev-commit'
fi
if [ -z "$GF_REFLOG_MENU_PARAMS" ]; then
export GF_REFLOG_MENU_PARAMS='--pretty=oneline --abbrev-commit'
fi
if [ -z "$GF_BASE_REMOTE" ]; then
export GF_BASE_REMOTE=origin
fi
if [ -z "$GF_BASE_BRANCH" ]; then
GF_BASE_BRANCH="$(git symbolic-ref -q "refs/remotes/${GF_BASE_REMOTE}/HEAD" || echo -n "main" | sed "s@^refs/remotes/${GF_BASE_REMOTE}/@@")"
export GF_BASE_BRANCH
fi
if [ -r "./.git-fuzzy-config" ]; then
# shellcheck disable=1091
. "./.git-fuzzy-config"
fi