-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy path.shared_rc
executable file
·80 lines (60 loc) · 1.81 KB
/
.shared_rc
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
#!/bin/sh
#
# Adam's shared interactive environment startup file
#
# $Id$
#
# This should get run as part of setting up the interactive
# environment of any sh-compatible shell; hence it should be kept as
# fast and as portable as possible. Note that that means silly things
# like [ ! -e foo ] rather than ! [ -e foo ] ...
[ -n "$shared_rc_loaded" ] && return 0
# {{{ HOME
# Don't leave history files in /
: ${HOME:=/}
if [ "$HOME" = '/' ]; then
if [ -d /root ]; then
HOME=/root
elif [ -d /var/tmp ]; then
new_home=/var/tmp/root.tmphome
if [ -d "$new_home" ] || mkdir "$new_home"; then
HOME="$new_home"
fi
fi
fi
[ "$HOME" = '/' ] && echo "Warning: ~ is /"
# }}}
# {{{ TERM check
if which tput >/dev/null 2>&1 && ! tput longname >/dev/null 2>&1; then
echo >&2 "\nWarning: $TERM not present in terminfo database; falling back to xterm."
TERM=xterm
fi
# }}}
# {{{ Pager
#export METAMAIL_PAGER='less -R'
#export PERLDOC_PAGER='less -R'
export PAGER='less'
# Could also include -J for making it more obvious where matches are,
# but extra first column is often annoying e.g. cut'n'paste, so better
# to have it off by default.
export LESS='-a -h100 -i -j15 -M -q -R -W -y100 -X'
export LESSOPEN="|$ZDOTDIR/bin/lesspipe.sh %s"
#export LESSCLOSE='/usr/local/bin/lessclose.sh %s %s'
# Make sure synced with .cfg-post.d/shell-env
export LESSKEY="$ZDOTDIR/.less"
# }}}
# {{{ POSIXLY_CORRECT for patch
#export POSIXLY_CORRECT=yes
# }}}
# {{{ COLUMNS
# Some programs find this handy. Unfortunately xterm gets confused
# when launched with it set ...
[ "${COLUMNS:-0}" -gt 0 ] && export COLUMNS
# }}}
# {{{ INPUTRC
# no crappy RedHat inputrcs, thankyouverymuch. Which fucking *idiot*
# set convert-meta to off?
[ -n "$INPUTRC" ] && unset INPUTRC
# }}}
. $ZDOT_RUN_HOOKS .shared_rc.d
shared_rc_loaded=y