-
Notifications
You must be signed in to change notification settings - Fork 1
/
.init-file.bash
53 lines (46 loc) · 1.56 KB
/
.init-file.bash
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
export PS1="\h:\W \u\$ "
source $(conda info --base)/etc/profile.d/conda.sh
conda deactivate
conda activate envs/super_hydro
alias ap="anaconda-project"
alias apr="anaconda-project run"
_exclude_array=(
-name ".hg" -or
-name ".git" -or
-name '.eggs' -or
-name '.ipynb_checkpoints' -or
-name 'envs' -or
-name "*.sage-*" -or
-name "_build" -or
-name "build" -or
-name "__pycache__"
)
# Finding stuff
function finda {
find . \( "${_exclude_array[@]}" \) -prune -or -type f \
-print0 | xargs -0 grep -H "${*:1}"
}
function findf {
include_array=( -name "*.$1" )
find . \( "${_exclude_array[@]}" \) -prune -or \( "${include_array[@]}" \) \
-print0 | xargs -0 grep -H "${*:2}"
}
function findpy { findf py "${*}"; }
function findipy { findf ipynb "${*}"; }
function findjs { findf js "${*}"; }
function findcss { findf css "${*}"; }
# Personal customizations... unlikely to work unless you configure your machine like mine.
if [ "$(whoami)" == "mforbes" ]; then
# Write this as a function so that we can run it in the background
# Should make these use existing variables
EMACSNAME=${EMACSNAME:-"Emacs"}
EMACSAPP=${EMACSAPP:-"/Applications/${EMACSNAME}.app"}
export EMACS=${EMACS:-"/Applications/${EMACSNAME}.app/Contents/MacOS/${EMACSNAME}"}
export EMACSCLIENT=${EMACSCLIENT:-"${EMACSAPP}/Contents/MacOS/bin/emacsclient"}
alias emacs_="${EMACS}"
function emacs {
"${EMACSCLIENT}" -a ${EMACS} --quiet --no-wait "$@" & disown
}
export emacs
alias hg="/data/apps/conda/bin/hg"
fi