-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbashrc
More file actions
79 lines (59 loc) · 1.68 KB
/
Copy pathbashrc
File metadata and controls
79 lines (59 loc) · 1.68 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
# .bashrc
[ -z "$PS1" ] && return
. ~/.env
[[ -f ~/.secretenv ]] && . ~/.secretenv
# don't put duplicate lines in the history. See bash(1) for more options
# ... or force ignoredups and ignorespace
HISTCONTROL=ignoredups:ignorespace
# append to the history file, don't overwrite it
shopt -s histappend
# set vi mode
set -o vi
# for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=10000
HISTFILESIZE=20000
# Source global definitions
[[ -f /etc/bashrc ]] && . /etc/bashrc
# source: https://github.com/scop/bash-completion/blob/main/README.md#installation
[[ ! ${BASH_COMPLETION_VERSINFO:-} &&
-f /usr/share/bash-completion/bash_completion ]] &&
. /usr/share/bash-completion/bash_completion
# User specific environment
alias ls="ls --color=auto"
export GPG_TTY=$(tty)
exitstatus() {
local s=$?
if [[ $s -eq 0 ]]; then
printf '\e[1;32m%s\e[0m' "$s"
else
printf '\e[1;31m%s\e[0m' "$s"
fi
}
PS1='[\[\e[1;35m\]\w\[\e[0m\]@\[\e[1;34m\]\H\[\e[0m\]] ($(exitstatus)) \t\n\$ '
VIRTUAL_ENV_DISABLE_PROMPT=1
. ~/.venv/bin/activate
[[ $(uname -s) == "Darwin" ]] && eval "$(/opt/homebrew/bin/brew shellenv)"
_scancel_fzf_completion() {
local selected_jobs
selected_jobs=$(squeue --me | tail -n +2 | fzf --multi --prompt="Select jobs to cancel: " | awk '{print $1}' | paste -sd' ' -)
if [[ -n "$selected_jobs" ]]; then
COMPREPLY=("$selected_jobs")
else
COMPREPLY=()
fi
}
complete -F _scancel_fzf_completion scancel
eval "$(fzf --bash)"
eval "$(zoxide init bash --cmd cd)"
alias yacc="bison"
alias today="date +%Y_%m_%d"
ovrpush() {
while true; do
if ! git pull; then
return 1
fi
if git push; then
return 0
fi
done
}