summaryrefslogtreecommitdiffstats
path: root/roles/common/files/zshrc
blob: 693d06ce22aaa86a56463ffd4c69517fd0d91c87 (plain)
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
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=2500
SAVEHIST=2500
bindkey -e
# End of lines configured by zsh-newuser-install
# The following lines were added by compinstall
#zstyle :compinstall filename '/home/casper/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ll='ls -lh'
alias f='find . -iname'
alias up='popd'
alias myip='curl https://lancaster.casperlefantom.net/ipclient.php'
alias torip='torsocks curl https://lancaster.casperlefantom.net/ipclient.php'
alias beep='echo -e "\a"'
alias screenoff='xset dpms force off'
alias ltx='tmux ls'
alias atx='tmux attach -t'
alias addkey='gpg --keyserver hkp://keys.fedoraproject.org --recv-key'
alias poezio='tmux -2 new-session -s poezio -n "poezio-debug by tor" "proxychains4 poezio --debug ~/.local/share/poezio/debug.log"'

# Define personal variables
if [ -f $HOME/bin/setvars ]; then
        . $HOME/bin/setvars
fi

# Print fedora linux logo in interactive shell
if [ -n "$PS1" ]; then
    if which linux_logo >/dev/null 2>&1; then
    linux_logo -L fedora -F "Bienvenue sur l'hôte #H\n#V, Compilé #C \n#P #X #T, #R, #U"
    fi
fi

setopt hist_ignore_space
setopt autocd
setopt correctall
autoload -U promptinit
promptinit
autoload -U colors
colors

HISTIGNORE="history:exit:logout"

if [[ "$EUID" = "0" ]] || [[ "$USER" = 'root' ]]; then
    base_prompt="%{$fg_bold[red]%}%m %{$fg_bold[blue]%}%~ %{$fg_bold[red]%}%#%{$reset_color%}%{$fg[red]%}"
else
    base_prompt="%{$fg_bold[green]%}%n%{$fg_bold[blue]%}@%{$fg_bold[yellow]%}%m%{$reset_color%} %{$fg_bold[blue]%}%~ %{$fg_bold[green]%}%#%{$reset_color%}%{$fg[green]%}"
fi
PS1="$base_prompt "
PS2='suite-> '