summaryrefslogtreecommitdiffstats
path: root/roles/common/files/zshrc
blob: 009d8174f13477dcff18ae6ca09ece08b43be3ff (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=25000
SAVEHIST=25000
HISTTIMEFORMAT="%d/%m/%y %T "
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

#allow tab completion in the middle of a word
setopt COMPLETE_IN_WORD

## history
setopt APPEND_HISTORY
## for sharing history between zsh processes
setopt INC_APPEND_HISTORY
setopt SHARE_HISTORY

alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
alias ll='ls -lh'
alias f='find . -iname'
alias up='popd'
alias pop='popd'
alias beep='echo -e "\a"'
alias screenoff='xset dpms force off'
alias fbx='curl -s $FBX | grep "mise en route" | cut -d " " -f10,11,12,13'
alias fbxlog='curl -s $FBX | grep -a "$(date +%x)"'
alias wifion='nmcli r wifi on'
alias wifioff='nmcli r wifi 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"'
alias tssh='torsocks ssh -F $HOME/.ssh/config2'
alias tscp='torsocks scp -F $HOME/.ssh/config2'
alias trsync='torsocks rsync -e "ssh -F $HOME/.ssh/config2"'
alias mnt='mount | column -t'


# Define personal variables
if [ -f $HOME/bin/setvars ]; then
    . $HOME/bin/setvars
fi
# Define personal functions
if [ -f $HOME/bin/setfunctions ]; then
    . $HOME/bin/setfunctions
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
setopt extendedhistory
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-> '