-
Notifications
You must be signed in to change notification settings - Fork 0
/
.mkshrc
45 lines (36 loc) · 844 Bytes
/
.mkshrc
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
# If not running interactively, don't do anything
[[ $- != *i* ]] && return
# Custom PS1 with ~ instead of /home/user
set_prompt() {
if [ "$PWD" = "$HOME" ]; then
IS_HOME="~"
else
IS_HOME="$PWD"
fi
PS1='$( echo -e "╭─\033[1m$HOSTNAME\033[0m: \033[1;32m$USER\033[0m at \033[3;35m$IS_HOME\033[0m\n╰─\033[1m>\033[0m ")'
}
# Reolad prompt when you cd
cd() {
builtin cd "$@"
set_prompt
}
# Set prompt at start
set_prompt
# mkcd function
mkcd () {
mkdir -p "$1" && cd "$1"
}
# Some usefull aliases
alias l="ls -l"
alias ll="ls -Al"
alias la="ls -A"
alias cls=clear
alias cat="cat -n"
alias google="ping google.com"
alias ..="cd ../"
alias ....="cd ../../"
alias ......="cd ../../../"
alias ........="cd ../../../../"
# Color aliases
alias ls="ls --color=auto"
alias grep="grep --color=auto"