/
.zshenv
66 lines (50 loc) · 1.76 KB
/
.zshenv
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
# zshrc file written for antigen's tests. Might not be a good one for daily use.
# See cram's documentation for some of the variables used below.
export ADOTDIR="$PWD/dot-antigen"
[[ ! -d "$ADOTDIR" ]] && mkdir -p "$ADOTDIR"
export _ANTIGEN_CACHE_ENABLED=true
export _ANTIGEN_INTERACTIVE_MODE=true
export _ZCACHE_EXTENSION_CLEAN_FUNCTIONS=false
test -f "$TESTDIR/.zcompdump" && rm "$TESTDIR/.zcompdump"
source "$TESTDIR/../antigen.zsh"
# A test plugin repository to test out antigen with.
export PLUGIN_DIR="$PWD/test-plugin"
mkdir "$PLUGIN_DIR"
# A wrapper function over `git` to work with the test plugin repo.
alias pg='git --git-dir "$PLUGIN_DIR/.git" --work-tree "$PLUGIN_DIR"'
echo 'alias hehe="echo hehe"' > "$PLUGIN_DIR"/aliases.zsh
echo 'export PS1="prompt>"' > "$PLUGIN_DIR"/silly.zsh-theme
{
pg init
pg add .
pg commit -m 'Initial commit'
} > /dev/null
# Another test plugin.
export PLUGIN_DIR2="$PWD/test-plugin2"
mkdir "$PLUGIN_DIR2"
# A wrapper function over `git` to work with the test plugin repo.
alias pg2='git --git-dir "$PLUGIN_DIR2/.git" --work-tree "$PLUGIN_DIR2"'
echo 'alias hehe2="echo hehe2"' > "$PLUGIN_DIR2"/init.zsh
echo -E 'alias prompt="\e]$ >\a\n"' >> "$PLUGIN_DIR2"/init.zsh
echo 'local root=${0}' >> "$PLUGIN_DIR2"/init.zsh
echo 'function root_source () {
echo $root/$0
}' >> "$PLUGIN_DIR2"/init.zsh
echo 'alias unsourced-alias="echo unsourced-alias"' > "$PLUGIN_DIR2"/aliases.zsh
{
pg2 init
pg2 add .
pg2 commit -m 'Initial commit'
} > /dev/null
# Wrapper around \wc command to handle wc format differences between GNU and BSD
# GNU:
# echo 1 | wc -l
# 1
# BSD:
# echo 1 | wc -l
# 1
#
# Using this wrapper output from both implementations resembles GNU's.
function wc () {
command wc "$@" | xargs
}