-
Notifications
You must be signed in to change notification settings - Fork 0
/
.bashrc
50 lines (36 loc) · 786 Bytes
/
.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
#!/bin/bash
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
### FUNCTIONS
function mkcd
{
mkdir -p -- "$1" && cd -P -- "$1"
}
function chr
{
echo "$@" | awk '{for (i = 1; i <= NF; i++) {printf("%c", strtonum($i))}}'
}
function is_windows
{
[[ -n "$WINDIR" ]];
}
### STARTUP
## dotnet wsl
if [ -d ~/.dotnet ]; then
export PATH="$PATH:$(realpath ~/.dotnet)"
fi
if command -v dotnet &> /dev/null
then
export DOTNET_ROOT="$(dotnet --info | grep -E 'Base Path:' | sed -E "s/[^\/]+(.+)\/sdk.+/\1/")"
fi
## prompt
# old custom
# PS1="\e[36m\w\$(__git_ps1 ' \e[32m(%s)') \e[33m→\e[39m "
# oh-my-posh
# eval "$(oh-my-posh init bash --config ~/.config.omp.json)"
# starship
if command -v starship &> /dev/null
then
eval "$(starship init bash)"
fi