-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdotprofile.template
108 lines (103 loc) · 2.97 KB
/
dotprofile.template
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# * bash env
export TERM=xterm-256color
# ** history related settings
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
export HISTCONTROL=ignoredups
# append to the history file, don't overwrite it
shopt -s histappend
shopt -s cmdhist
shopt -s lithist
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
export HISTTIMEFORMAT=' %F %T '
export HISTSIZE=10000
export HISTFILESIZE=10000
export HISTIGNORE=?:??
export SHELL_SESSION_HISTORY=0
# check the window size after each command and, if necessary,
# update the values of LINES and COLUMNS.
shopt -s checkwinsize
# ** env
# force to two PATH to make sure they are there
export PATH=/usr/local/bin:/usr/bin:${PATH}
# *** homebrew
# Ref:https://brew.sh/2021/02/05/homebrew-3.0.0/
check_brew="/opt/homebrew"
# Ref: GNU utils
# https://apple.stackexchange.com/questions/69223/how-to-replace-mac-os-x-utilities-with-gnu-core-utilities
if [ -d ${check_brew} ]
then
BREW_PATH="/opt/homebrew"
export PATH=${BREW_PATH}/bin:${PATH}
else
BREW_PATH="/usr/local"
fi
BREW_GNUPATH=${BREW_PATH}/opt/coreutils/libexec/gnubin
if [ -d ${BREW_GNUPATH} ]
then
export PATH=${BREW_GNUPATH}:${PATH}
export MANPATH=${BREW_PATH}/opt/coreutils/libexec/gnuman:${MANPATH}
fi
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
export PS1="> "
# auto complete for make command
complete -W "\`grep -oE '^[a-zA-Z0-9_.-]+:([^=]|$)' ?akefile | sed 's/[^a-zA-Z0-9_.-]*$//'\`" make
alias ls='ls --color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias mygitignore='git status --porcelain | grep '^??' | cut -c4- >>.gitignore'
# * conda: change __conda_setup manually
# - change shell.zsh to shell.bash manually
# - use CONDA_BIN manually
case $HOSTNAME in
*imac*)
CONDA_PATH="${HOME}/mambaforge"
;;
*pro*)
CONDA_PATH="${HOME}miniforge"
;;
tscc*)
CONDA_PATH="${HOME}/miniconda3"
;;
*)
;;
esac
__conda_setup="$(${CONDA_PATH}/bin/conda 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "${CONDA_PATH}/etc/profile.d/conda.sh" ]; then
. "${CONDA_PATH}/etc/profile.d/conda.sh"
else
export PATH="${CONDA_PATH}/bin:$PATH"
fi
fi
unset __conda_setup
mamba_script=${CONDA_PATH}/etc/profile.d/mamba.sh
if [ -f ${mamba_script} ]; then
source ${mamba_script}
fi
export WORKON_HOME=${CONDA_PATH}/envs
export CONDA_AUTO_ACTIVATE_BASE=true
# * emacs
# for lsp-mode
# https://emacs-lsp.github.io/lsp-mode/page/performance/
export LSP_USE_PLISTS=true
# * goolge cloud SDK
case $HOSTNAME in
tscc*)
GOOGLE_SDK="${HOME}/softwares/google-cloud-sdk"
if [ -f ${GOOGLE_SDK}/path.bash.inc ]
then
source ${GOOGLE_SDK}/path.bash.inc
fi
if [ -f ${GOOGLE_SDK}/completion.bash.inc ]
then
source ${GOOGLE_SDK}/completion.bash.inc
fi
;;
*)
;;
esac