-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathzshrc
More file actions
executable file
·117 lines (87 loc) · 2.97 KB
/
zshrc
File metadata and controls
executable file
·117 lines (87 loc) · 2.97 KB
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
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
# completion
setopt always_to_end
setopt append_history
setopt auto_cd
setopt auto_menu
setopt auto_remove_slash
setopt complete_in_word
setopt histignorespace
unset CASE_SENSITIVE
autoload -U compinit
compinit -C
export PROMPT='%B%(?..[%?] )%b→ '
export RPROMPT="%F{${1:-green}}%~%f"
if [ -n "$SSH_CLIENT" ]; then
export PROMPT="%F{${1:-yellow}}<%M>%f $PROMPT"
fi
autoload predict-on
autoload predict-off
bindkey -e
bindkey "${terminfo[khome]}" beginning-of-line
bindkey "${terminfo[kend]}" end-of-line
## case-insensitive (all),partial-word and then substring completion
zstyle ':completion:*' matcher-list 'm:{a-zA-Z}={A-Za-z}' 'r:|[._-]=* r:|=*' 'l:|=* r:|=*'
zstyle ':completion:*' list-colors "=(#b) #([0-9]#)*=36=31"
zstyle ":completion:*" verbose yes
zstyle ":completion:*" list-dirs-first true
zstyle ':completion:*:descriptions' format '%U%B%d%b%u'
zstyle ':completion:*:warnings' format '%BSorry, no matches'
#history
HISTSIZE=50000
SAVEHIST=50000
HISTFILE=~/.history
export EDITOR="vim"
export SUDO_EDITOR="$EDITOR"
export XDG_CURRENT_DESKTOP=GNOME
# 10 second wait for delete everythings
#setopt RM_STAR_WAIT
setopt NO_BEEP
setopt NO_CASE_GLOB
# general aliases
alias ll='ls -l'
alias tmux="tmux -2"
alias e=$EDITOR
alias o="xdg-open"
alias home_screens="xrandr --output eDP1 --mode 1920x1080 && xrandr --output VGA1 --mode 1440x900 --right-of eDP1"
st(){sudo strace -e open $(ps -o lwp= -LC $1 | sed 's/^/-p/')}
list_packages(){expac -s "%-30n %m" | sort -hk 2 | awk '{printf "%s %.0f MiB\n", $1, $2/1024/1024}' | column -t }
get_random_file(){find . -type f | shuf -n 1}
function difflines(){git diff --no-index $1 $2}
function diffchars(){git diff --color-words=. --no-index $1 $2}
function diffwords(){git diff --color-words='[^[:space:]]|([[:alnum:]]|UTF_8_GUARD)+' --no-index $1 $2}
# Turn virtualenvs on/off
function von(){
dirname=$(basename $(pwd))
if [[ -f env/bin/activate ]]; then
source env/bin/activate
elif [[ -n $dirname && -d $HOME/envs/$dirname ]]; then
source $HOME/envs/$dirname/bin/activate
fi
}
function voff(){deactivate}
alias resetres="xrandr --output eDP1 --mode 1920x1080"
alias clip="xclip -selection clipboard"
alias rg="rg -S"
export wlan="wlan0"
alias wifi-status="iwctl station $wlan show"
alias wifi-scan="iwctl station $wlan scan; iwctl station $wlan get-networks"
alias wifi-connect="iwctl station $wlan connect"
alias gpm="git push origin master"
if hash nvim 2> /dev/null; then
alias vim="nvim"
fi
alias -g ...='../../' #cd ...
alias -g ....='../../../' #cd ....
alias -g .....='../../../../' #cd .....
for c in tar mv cp rm chmod chown rename link rmdir; do
alias $c="$c -v"
done
source $HOME/.profile
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib
export FZF_DEFAULT_COMMAND='rg --files'
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
export SYSTEMD_EDITOR="vim"
[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh
[ -f ~/.zshrc.local ] && source ~/.zshrc.local