-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashrc
More file actions
91 lines (74 loc) · 2.07 KB
/
bashrc
File metadata and controls
91 lines (74 loc) · 2.07 KB
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
#!/usr/bin/bash
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
shopt -s direxpand
export ALTERNATE_EDITOR=vim
export EDITOR="emacsclient -t"
export VISUAL="emacsclient -c -a emacs"
export PAGER=less
if [[ $INSIDE_EMACS =~ ,comint ]]; then
export PAGER=cat
fi
set -o noclobber
PS1='\\$ '
function messdir () {
printf "$HOME/mess/%(%Y/%W)T\n"
}
# mess and the c (pushd) and p (popd) aliases break directory tracking
# in the EMACS shell.
function mess () {
local C
local M
M="$(messdir)"
C="$HOME/mess/current"
if [[ $(readlink $C) != $M ]]; then
mkdir -p $M
rm -f $C
ln -s $M $C
fi
pushd $C
}
alias objdump="/usr/bin/objdump -Mintel"
alias disassemble="objdump -Cdr --visualize-jumps=color"
alias grep="/usr/bin/grep --color=auto"
alias egrep="/usr/bin/egrep --color=auto"
alias fgrep="/usr/bin/fgrep --color=auto"
alias rgrep="/usr/bin/rgrep --color=auto"
alias ls="ls --color=auto -F"
alias rm="/usr/bin/rm -i"
alias cp="/usr/bin/cp -i"
alias mv="/usr/bin/mv -i"
alias c="pushd"
alias p="popd"
alias o="$PAGER"
alias v="gio open"
if [[ -r $HOME/.dircolors ]]; then
eval $(dircolors -b $HOME/.dircolors)
fi
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
# opam configuration
test -r /home/sbi/.opam/opam-init/init.sh && . /home/sbi/.opam/opam-init/init.sh > /dev/null 2> /dev/null || true
export RUST_BACKTRACE=1
[ -f "/home/sbi/.ghcup/env" ] && source "/home/sbi/.ghcup/env" # ghcup-env
# docker rootless configuration
if [[ -v XDG_RUNTIME_DIR ]]; then
export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock
fi
function sage () {
podman run -v "$PWD:/home/sage/data" -it docker.io/sagemath/sagemath:latest
}
function sage_nb () {
podman run -v "$PWD:/home/sage/data" -p8888:8888 docker.io/sagemath/sagemath:latest sage-jupyter
}
function R () {
podman run -v "$PWD:/home/docker" -it --rm docker.io/r-base:latest
}