-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
146 lines (123 loc) · 5.39 KB
/
.bashrc
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
# ~/.bashrc
# ██╗ █████╗ ██╗ ██╗███████╗██╗ ██╗███╗ ███╗██╗██╗ ██╗ █████╗ ███╗ ██╗████████╗ █████╗
# ██║ ██╔══██╗██║ ██╔╝██╔════╝██║ ██║████╗ ████║██║██║ ██╔╝██╔══██╗████╗ ██║╚══██╔══╝██╔══██╗
# ██║ ███████║█████╔╝ ███████╗███████║██╔████╔██║██║█████╔╝ ███████║██╔██╗ ██║ ██║ ███████║
# ██║ ██╔══██║██╔═██╗ ╚════██║██╔══██║██║╚██╔╝██║██║██╔═██╗ ██╔══██║██║╚██╗██║ ██║ ██╔══██║
# ███████╗██║ ██║██║ ██╗███████║██║ ██║██║ ╚═╝ ██║██║██║ ██╗██║ ██║██║ ╚████║ ██║ ██║ ██║
# ╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═╝ ╚═╝ ╚═╝
#Locale for terminal
LANG="en_IN.utf8"
export LANG
### EXPORT
export TERM="xterm-256color" # getting proper colors
export EDITOR="nvim" # $EDITOR use NeoVim in terminal
export VISUAL="nvim" # $VISUAL use NeoVim in GUI mode
### SET MANPAGER
# "bat" as manpager
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
### PROMPT
PS1='\[\e[0;1;38;5;203m\]\h\[\e[0;1;97m\]@\[\e[0;1;38;5;49m\]\u\[\e[0;1;2;38;5;226m\]:\[\e[0;1;2;38;5;226m\]:\[\e[0;2;3;38;5;227m\]\w\n \[\e[0;38;5;43m\]➜ \[\e[0m\]'
# Add sbin directories to PATH. This is useful on systems that have sudo
echo $PATH | grep -Eq "(^|:)/sbin(:|)" || PATH=$PATH:/sbin
echo $PATH | grep -Eq "(^|:)/usr/sbin(:|)" || PATH=$PATH:/usr/sbin
######### PATH
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"
export PATH="$PATH:$HOME/.local/bin/"
##### Deno PATH
export DENO_INSTALL="/home/lakshmi/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
### NPM Global Config
NPM_PACKAGES="${HOME}/.npm-packages"
export PATH="$PATH:$NPM_PACKAGES/bin"
export PATH="$PATH:${HOME}/.yarn/bin"
# Preserve MANPATH if you already defined it somewhere in your config.
# Otherwise, fall back to `manpath` so we can inherit from `/etc/manpath`.
export MANPATH="${MANPATH-$(manpath)}:$NPM_PACKAGES/share/man"
### CHANGE TITLE OF TERMINALS
case ${TERM} in
xterm*|rxvt*|Eterm*|aterm|kterm|kitty|gnome*|alacritty|st|konsole*)
PROMPT_COMMAND='echo -ne "\033]0;${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\007"'
;;
screen*)
PROMPT_COMMAND='echo -ne "\033_${USER}@${HOSTNAME%%.*}:${PWD/#$HOME/\~}\033\\"'
;;
xterm-color) color_prompt=yes ;;
esac
#ignore upper and lowercase when TAB completion
bind "set completion-ignore-case on"
### ARCHIVE EXTRACTION
# usage: ex <file>
extract ()
{
if [ -f "$1" ] ; then
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.rar) unrar x $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.Z) uncompress $1 ;;
*.7z) 7z x $1 ;;
*.deb) ar x $1 ;;
*.tar.xz) tar xf $1 ;;
*.tar.zst) unzstd $1 ;;
*) echo "'$1' cannot be extracted via ex()" ;;
esac
else
echo "'$1' is not a valid file"
fi
}
############# navigation
up () {
local d=""
local limit="$1"
# Default to limit of 1
if [ -z "$limit" ] || [ "$limit" -le 0 ]; then
limit=1
fi
for ((i=1;i<=limit;i++)); do
d="../$d"
done
# perform cd. Show error if cd fails
if ! cd "$d"; then
echo "Couldn't go up $limit dirs.";
fi
}
######### Alias definitions.
if [ -f ~/.bash_aliases ]; then
. ~/.aliases
fi
# pnpm
export PNPM_HOME="/home/lakshmi/.local/share/pnpm"
case ":$PATH:" in
*":$PNPM_HOME:"*) ;;
*) export PATH="$PNPM_HOME:$PATH" ;;
esac
# pnpm end
########################################################################
############### Styling ###############
########################################################################
#starship startup scripts
#eval "$(starship init bash)"
#Customized start programe
#neofetch
neofetch --ascii ~/.config/neofetch/images/picachu.txt
# Set a default prompt
exec zsh
# bun
export BUN_INSTALL="$HOME/.bun"
export PATH=$BUN_INSTALL/bin:$PATH
# fnm
FNM_PATH="/home/lakshmi/.local/share/fnm"
if [ -d "$FNM_PATH" ]; then
export PATH="$FNM_PATH:$PATH"
eval "`fnm env`"
fi