-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdot_bashrc
More file actions
116 lines (92 loc) · 2.98 KB
/
dot_bashrc
File metadata and controls
116 lines (92 loc) · 2.98 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# User specific environment
if ! [[ "$PATH" =~ "$HOME/.local/bin:$HOME/bin:" ]]; then
PATH="$HOME/.local/bin:$HOME/bin:$PATH"
fi
export PATH
# Uncomment the following line if you don't like systemctl's auto-paging feature:
# export SYSTEMD_PAGER=
# User specific aliases and functions
if [ -d ~/.bashrc.d ]; then
for rc in ~/.bashrc.d/*; do
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi
unset rc
if [ -z "$XDG_STATE_HOME" ]; then
export XDG_STATE_HOME="$HOME/.local/state"
fi
if [ -z "$XDG_DATA_HOME" ]; then
export XDG_DATA_HOME="$HOME/.local/share"
fi
if [ -z "$XDG_CONFIG_HOME" ]; then
export XDG_CONFIG_HOME="$HOME/.config"
fi
if [ -f "/run/.containerenv" ]; then
TOOLBOX_NAME=$(cat /run/.containerenv | grep 'name=' | sed -e 's/^name="\(.*\)"$/\1/')
alias docker="flatpak-spawn --host docker"
alias podman="flatpak-spawn --host podman"
else
TOOLBOX_NAME=""
fi
# Default editor
export EDITOR="$(command -v nvim)"
# More history!
export HISTSIZE=10000
export HISTFILESIZE=10000
# Shell niceties
eval "$(starship init bash)"
eval "$(fzf --bash)"
# fzf stuff
export FZF_DEFAULT_OPTS='
--height -3
--color=fg+:#e0e2ea,info:#ffc0b9,spinner:#a6dbff,bg+:#4F5258,pointer:#fce094,hl:#fce094,bg:#14161b,fg:#e0e2ea,prompt:#b4f6c0,marker:#fce094,header:#a6dbff,hl+:#fce094
--border="sharp" --border-label="" --preview-window="border-sharp" --prompt="$ "
--marker=">" --pointer="*" --separator="-" --scrollbar="│"
--layout="reverse"'
export FZF_CTRL_T_OPTS="
--header 'Paste the selected files and directories onto the command-line '
--walker file,dir
--walker-skip .git,node_modules,target
--preview 'bat -n --color=always {}'"
export FZF_ALT_C_OPTS="
--header 'cd into the selected directory '
--walker dir
--walker-skip .git,node_modules,target
--preview 'tree -C {}'"
export FZF_CTRL_R_OPTS="
--header 'Paste the selected command from history onto the command-line'"
# Remap C-t to C-o for fzf
bind -x '"\C-o": fzf-file-widget'
bind '"\C-t": transpose-chars'
# Make certain things XDG compliant
export HISTFILE="${XDG_STATE_HOME}"/bash/history
export NODE_REPL_HISTORY="$XDG_STATE_HOME"/node_repl_history
export CARGO_HOME="$XDG_DATA_HOME"/cargo
export CGDB_DIR="$XDG_CONFIG_HOME"/cgdb
export RUSTUP_HOME="$XDG_DATA_HOME"/rustup
# atac stuff
export ATAC_MAIN_DIR="$HOME/dev/api"
# sdkman stuff
export SDKMAN_DIR="$XDG_DATA_HOME/sdkman"
[[ -s "$SDKMAN_DIR/bin/sdkman-init.sh" ]] && source "$SDKMAN_DIR/bin/sdkman-init.sh"
# cargo stuff
. "$CARGO_HOME/env"
# volta stuff
export VOLTA_HOME="$XDG_DATA_HOME/volta"
export PATH="$VOLTA_HOME/bin:$PATH"
# android stuff
export ANDROID_HOME="$HOME/dev/android/android_sdk"
export ANDROID_SDK_ROOT="$HOME/dev/android/android_sdk"
export PATH="$PATH:$ANDROID_HOME/platform-tools"
# go stuff
export GOPATH="$XDG_DATA_HOME/go"
export PATH="$PATH:$GOPATH/bin"
alias renoise="chrt -f 99 renoise"
alias reaper="chrt -f 99 reaper"