diff options
Diffstat (limited to 'bash')
-rw-r--r-- | bash/.bash_aliases | 30 | ||||
-rw-r--r-- | bash/.bash_profile | 8 | ||||
-rwxr-xr-x | bash/.bash_prompt | 52 | ||||
-rw-r--r-- | bash/.bashrc | 144 |
4 files changed, 234 insertions, 0 deletions
diff --git a/bash/.bash_aliases b/bash/.bash_aliases new file mode 100644 index 0000000..fa78f7b --- /dev/null +++ b/bash/.bash_aliases | |||
@@ -0,0 +1,30 @@ | |||
1 | |||
2 | alias ...='cd -- ../..' | ||
3 | alias grep='grep --color=auto' | ||
4 | alias l='ls -CF' | ||
5 | alias la='ls -A' | ||
6 | alias ll='ls -alF' | ||
7 | alias ls='ls -F --color=always' | ||
8 | alias nerdz='~/scripts/nerdinfo.sh' | ||
9 | alias o='xdg-open' | ||
10 | alias rless='less -r' | ||
11 | alias spdtst='curl -o /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip' | ||
12 | alias tmux='tmux -u' | ||
13 | alias tree='tree -C' | ||
14 | alias vim='nvim' | ||
15 | alias vime='nvim ~/.vim/vimrc' | ||
16 | |||
17 | # git aliases | ||
18 | alias gb='git branch -v' | ||
19 | alias gc='git commit --verbose' | ||
20 | alias gd='git diff --minimal' | ||
21 | alias ggp='git push' | ||
22 | alias gl='git log -p --abbrev-commit --pretty=medium' | ||
23 | alias glo='git log --pretty=oneline --abbrev-commit' | ||
24 | alias gst='git status --short' | ||
25 | |||
26 | # xbps | ||
27 | alias +='sudo xbps-install' | ||
28 | alias ?='xbps-query -Rs' | ||
29 | alias ~='sudo xbps-remove' | ||
30 | |||
diff --git a/bash/.bash_profile b/bash/.bash_profile new file mode 100644 index 0000000..d7df6a9 --- /dev/null +++ b/bash/.bash_profile | |||
@@ -0,0 +1,8 @@ | |||
1 | # .bash_profile | ||
2 | |||
3 | # Get the aliases and functions | ||
4 | [ -f $HOME/.bashrc ] && . $HOME/.bashrc | ||
5 | |||
6 | |||
7 | |||
8 | export PATH="$HOME/.poetry/bin:$PATH" | ||
diff --git a/bash/.bash_prompt b/bash/.bash_prompt new file mode 100755 index 0000000..667d32a --- /dev/null +++ b/bash/.bash_prompt | |||
@@ -0,0 +1,52 @@ | |||
1 | red="\e[31m" | ||
2 | grn="\e[32m" | ||
3 | ylw="\e[33m" | ||
4 | cyn="\e[36m" | ||
5 | blu="\e[34m" | ||
6 | prp="\e[35m" | ||
7 | bprp="\e[35;1m" | ||
8 | gry="\e[94m" | ||
9 | rst="\e[0m" | ||
10 | |||
11 | git_branch() { | ||
12 | local git_status="$(git status 2> /dev/null)" | ||
13 | local on_branch="On branch ([^${IFS}]*)" | ||
14 | local on_commit="HEAD detached at ([^${IFS}]*)" | ||
15 | |||
16 | if [[ $git_status =~ $on_branch ]]; then | ||
17 | local branch=${BASH_REMATCH[1]} | ||
18 | echo -ne "\001${cyn}\002 $branch\001${rst}\002" | ||
19 | elif [[ $git_status =~ $on_commit ]]; then | ||
20 | local commit=${BASH_REMATCH[1]} | ||
21 | echo -ne "\001${prp}\002 $commit\001${rst}\002" | ||
22 | fi | ||
23 | } | ||
24 | |||
25 | prompt_pwd() { | ||
26 | if [ "$PWD" == "$HOME" ]; then | ||
27 | echo "" | ||
28 | elif [ "$PWD" == "/" ]; then | ||
29 | echo "/" | ||
30 | else | ||
31 | path="$(echo $PWD | sed -e "s-$HOME/--g")" | ||
32 | echo -ne " \001${gry}\002$path/\001${rst}\002" | ||
33 | fi | ||
34 | } | ||
35 | |||
36 | rootornot() { | ||
37 | if [[ "$(id -u)" -eq 0 ]]; then | ||
38 | echo -ne "\001${red}\002#\001${rst}\002" | ||
39 | else | ||
40 | echo -ne "$" | ||
41 | fi | ||
42 | } | ||
43 | |||
44 | host() { | ||
45 | if [ "$HOSTNAME" == "localhost" ]; then | ||
46 | echo -ne "(phone)" | ||
47 | fi | ||
48 | } | ||
49 | |||
50 | PS1='\n$(pista)' | ||
51 | |||
52 | PS2=" > " | ||
diff --git a/bash/.bashrc b/bash/.bashrc new file mode 100644 index 0000000..c61dc42 --- /dev/null +++ b/bash/.bashrc | |||
@@ -0,0 +1,144 @@ | |||
1 | export PATH=$PATH":$HOME/.cargo/bin" | ||
2 | export PATH=$PATH":$HOME/.poetry/bin" | ||
3 | export PATH=$PATH":$HOME/scripts" | ||
4 | export PATH=$PATH":$HOME/bin" | ||
5 | export PATH=$PATH":$HOME/.cabal/bin" | ||
6 | export PATH=$PATH":$HOME/leet/flutter/bin" | ||
7 | export PATH=$PATH":$HOME/.local/bin" | ||
8 | export PATH=$PATH":/usr/lib/jvm/jdk-14/bin" | ||
9 | export PATH=$PATH":/usr/local/texlive/2020/bin/x86_64-linux/" | ||
10 | export PATH=$PATH":/usr/local/go/bin" | ||
11 | |||
12 | export AIRFLOW_HOME="$HOME/.config/airflow" | ||
13 | export ANDROID_HOME="$HOME/leet/ndk/android-ndk-r21c/toolchains" | ||
14 | export EDITOR=/bin/nvim | ||
15 | export MANPAGER="less" | ||
16 | export BROWSER="/bin/firefox" | ||
17 | export GPG_TTY=$(tty) | ||
18 | export TERM=xterm-256color-italic | ||
19 | export TZ='Asia/Kolkata' | ||
20 | export FZF_DEFAULT_OPTS='--height 40% --layout=reverse --color=bw' | ||
21 | |||
22 | export GUILE_LOAD_PATH="/usr/local/share/guile/3.0:/usr/local/share/guile" | ||
23 | |||
24 | export GCC_COLORS='error=01;31:warning=01;35:note=01;36:caret=01;32:locus=01:quote=01' | ||
25 | |||
26 | case $- in | ||
27 | *i*) ;; | ||
28 | *) return;; | ||
29 | esac | ||
30 | |||
31 | # better history syncing | ||
32 | shopt -s histappend | ||
33 | export HISTCONTROL=ignoreboth:erasedups | ||
34 | HISTSIZE=1000 | ||
35 | HISTFILESIZE=2000 | ||
36 | export PROMPT_COMMAND='' | ||
37 | export PROMPT_COMMAND="${PROMPT_COMMAND:+$PROMPT_COMMAND$'\n'}history -a; history -c; history -r" | ||
38 | |||
39 | # cool options for cool kids | ||
40 | shopt -s \ | ||
41 | autocd \ | ||
42 | globstar \ | ||
43 | checkwinsize \ | ||
44 | cdspell \ | ||
45 | dirspell \ | ||
46 | expand_aliases \ | ||
47 | dotglob \ | ||
48 | gnu_errfmt \ | ||
49 | histreedit \ | ||
50 | nocasematch | ||
51 | |||
52 | bind 'set completion-ignore-case on' | ||
53 | bind 'set show-all-if-ambiguous on' | ||
54 | bind 'set colored-stats on' | ||
55 | bind 'set completion-display-width 1' | ||
56 | bind 'TAB:menu-complete' | ||
57 | bind "t: $HOME/scripts/tmux-fzf.sh" | ||
58 | bind Space:magic-space | ||
59 | |||
60 | if ! shopt -oq posix; then | ||
61 | if [ -f /usr/share/bash-completion/bash_completion ]; then | ||
62 | . /usr/share/bash-completion/bash_completion | ||
63 | elif [ -f /etc/bash_completion ]; then | ||
64 | . /etc/bash_completion | ||
65 | fi | ||
66 | fi | ||
67 | |||
68 | # local bash completions | ||
69 | for cf in "$HOME"/.bash_completion.d/* ; do | ||
70 | . $cf | ||
71 | done | ||
72 | |||
73 | [ -f ~/.bash_aliases ] && . ~/.bash_aliases | ||
74 | [ -f ~/.bash_prompt ] && . ~/.bash_prompt | ||
75 | [ -f ~/.fzf.bash ] && source ~/.fzf.bash | ||
76 | |||
77 | export NVM_DIR="$HOME/.nvm" | ||
78 | [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm | ||
79 | [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion | ||
80 | |||
81 | # pfetch | ||
82 | export PF_INFO="ascii title os kernel uptime pkgs shell " | ||
83 | export PF_SEP=" " | ||
84 | export PF_COL1=7 | ||
85 | export PF_COL2=7 | ||
86 | export PF_COL3=6 | ||
87 | export PF_ALIGN="9" | ||
88 | export PF_ASCII="void" | ||
89 | |||
90 | export _JAVA_AWT_WM_NONREPARENTING=1 | ||
91 | |||
92 | # [[ -f ~/.bash-preexec.sh ]] && source ~/.bash-preexec.sh | ||
93 | # [[ -f ~/.bash_zoxide.sh ]] && source ~/.bash_zoxide.sh | ||
94 | # | ||
95 | # export PATH_TO_FX="$HOME/dloads/javafx/javafx-sdk-11.0.2/lib" | ||
96 | # export JAVA_HOME="/usr/lib/jvm/jdk-14" | ||
97 | # | ||
98 | # for file in `find ~/dloads/nlp/stanford-corenlp-full-2018-10-05/ -name "*.jar"`; do | ||
99 | # export CLASSPATH="$CLASSPATH:`realpath $file`" | ||
100 | # done | ||
101 | |||
102 | # tabtab source for packages | ||
103 | # uninstall by removing these lines | ||
104 | [ -f ~/.config/tabtab/__tabtab.bash ] && . ~/.config/tabtab/__tabtab.bash || true | ||
105 | |||
106 | # Pista stuff | ||
107 | # prompt string to display, for regular users | ||
108 | export PROMPT_CHAR="$" | ||
109 | export PROMPT_CHAR_COLOR="cyan" | ||
110 | |||
111 | # prompt string to display, for the root user | ||
112 | export PROMPT_CHAR_ROOT="#" | ||
113 | export PROMPT_CHAR_ROOT_COLOR="magenta" | ||
114 | |||
115 | # if SHORTEN_CWD is set to 1, `/home/nerdypepper/code` is shortened to | ||
116 | # `/h/n/code` | ||
117 | export SHORTEN_CWD=1 | ||
118 | export CWD_COLOR="white" | ||
119 | |||
120 | # if EXPAND_TILDE is set to 0, `/home/nerdypepper` is shortened to `~` | ||
121 | export EXPAND_TILDE=0 | ||
122 | |||
123 | # there are three possible states for a git repo | ||
124 | # - unstaged (working tree has been modified) | ||
125 | # - staged (staging area has been modified) | ||
126 | # - clean (all staged changes have committed) | ||
127 | |||
128 | # symbol to represent clean repo state | ||
129 | export GIT_CLEAN="·" | ||
130 | export GIT_CLEAN_COLOR="green" | ||
131 | |||
132 | # symbol to represent unstaged repo state | ||
133 | export GIT_WT_MODIFIED="×" | ||
134 | export GIT_WT_MODIFIED_COLOR="red" | ||
135 | |||
136 | # symbol to represent staged repo state | ||
137 | export GIT_INDEX_MODIFIED="±" | ||
138 | export GIT_INDEX_MODIFIED_COLOR="yellow" | ||
139 | |||
140 | # if HEAD ref peels to branch | ||
141 | export BRANCH_COLOR="bright black" | ||
142 | |||
143 | # if HEAD ref peels to a commit (detached state) | ||
144 | export COMMIT_COLOR="green" | ||