Mercurial > hg > zsh-env
annotate zshrc-linux-gnu @ 180:bfc94ec31b2b
allow a local include in .gitconfig
author | Dirk Olmes <dirk.olmes@codedo.de> |
---|---|
date | Tue, 04 Aug 2020 11:20:15 +0200 |
parents | 2cc8820caae0 |
children |
rev | line source |
---|---|
0
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
1 # |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
2 # zshrc-linux-gnu: zsh env for various linux distributions |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
3 # |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
4 |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
5 # custom environment variables |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
6 export LESS="-X" |
5
2cd74a85976a
change the prompt when running in a screen session
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
0
diff
changeset
|
7 |
0
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
8 PROMPT="%m%# " |
5
2cd74a85976a
change the prompt when running in a screen session
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
0
diff
changeset
|
9 if [[ "$TERM" =~ screen ]]; then |
2cd74a85976a
change the prompt when running in a screen session
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
0
diff
changeset
|
10 PROMPT="(s)%m%# " |
2cd74a85976a
change the prompt when running in a screen session
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
0
diff
changeset
|
11 fi |
0
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
12 |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
13 # try to guess the distribution and include a special script for that |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
14 local linux_distro="unknown" |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
15 if [ -d /usr/portage ]; then |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
16 linux_distro="gentoo" |
42 | 17 elif [ -f /etc/centos-release ]; then |
18 linux_distro="centos" | |
169
2cc8820caae0
extend the distribution detection mechanism
Dirk Olmes <dirk.olmes@codedo.de>
parents:
42
diff
changeset
|
19 elif [ -d /etc/apt ]; then |
2cc8820caae0
extend the distribution detection mechanism
Dirk Olmes <dirk.olmes@codedo.de>
parents:
42
diff
changeset
|
20 linux_distro="debian" |
0
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
21 fi |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
22 |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
23 # now source the distro zshrc file if it exists |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
24 local distro_zshrc=$HOME/.zsh-env/zshrc-${linux_distro} |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
25 if [ -r "${distro_zshrc}" ]; then |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
26 . ${distro_zshrc} |
8b245298349a
zsh environment - initial import
Dirk Olmes <dirk@xanthippe.ping.de>
parents:
diff
changeset
|
27 fi |