guest@dotshare [~/groups/shells/zsh] $ ls zshrc/ | cat

.zshrc (scrot)

cmdywrtr27 Aug 17, 2020 (shells/zsh)

.zshrc(raw, dl)

SCROT

  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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
export TERMCMD=urxvtc
export BROWSER=/usr/bin/firefox
export LANG=en_US.UTF-8
export SUDO_EDITOR=nano
export VISUAL=nano
export EDITOR=nano
export MANPAGER="sh -c 'col -bx | bat -l man -p'"
export PAGER="most"
export PATH="/home/josh/.cargo/bin:$PATH"
export PATH="/home/josh/.local/bin:$PATH"
export FZF_DEFAULT_OPS="--extended"
export FZF_DEFAULT_COMMAND="fd --type f"
export FZF_CTRL_T_COMMAND="$FZF_DEFAULT_COMMAND"
source /usr/share/z/z.sh
source /home/josh/.zsh_aliases
# For tmux in linux
export EVENT_NOEPOLL=1
#================================================================================
# DO NOT EDIT AFTER THIS LINE
# The following lines were added by compinstall

zstyle ':completion:*' auto-description 'Introduce %d'
zstyle ':completion:*' completer _oldlist _expand _complete _ignored _match _correct _approximate _prefix
zstyle ':completion:*' completions 1
zstyle ':completion:*' condition 0
zstyle ':completion:*' expand prefix
zstyle ':completion:*' file-sort name
zstyle ':completion:*' format 'Completing %d'
zstyle ':completion:*' glob 1
zstyle ':completion:*' group-name ''
zstyle ':completion:*' insert-unambiguous true
zstyle ':completion:*' list-colors ''
zstyle ':completion:*' list-prompt '%SHit TAB for more results...%s'
zstyle ':completion:*' list-suffixes true
zstyle ':completion:*' matcher-list '' '+m:{[:lower:]}={[:upper:]} m:{[:lower:][:upper:]}={[:upper:][:lower:]}' '+r:|[._-]=* r:|=*'
zstyle ':completion:*' max-errors 2
zstyle ':completion:*' menu select=0
zstyle ':completion:*' original true
zstyle ':completion:*' preserve-prefix '//[^/]##/'
zstyle ':completion:*' prompt 'Found %e errors...'
zstyle ':completion:*' select-prompt '%SScrolling active: current selection at %p%s'
zstyle ':completion:*' substitute 1
zstyle ':completion:*' verbose true
zstyle :compinstall filename '/home/josh/.zshrc'

autoload -Uz compinit
compinit
# End of lines added by compinstall
# Lines configured by zsh-newuser-install
HISTFILE=~/.histfile
HISTSIZE=10000
SAVEHIST=10000
setopt appendhistory autocd extendedglob nomatch
unsetopt beep
bindkey -v
# End of lines configured by zsh-newuser-install
# DO NOT EDIT BEFORE THIS LINE
#================================================================================
# Own configuration:
setopt nohashdirs
setopt completealiases
setopt INC_APPEND_HISTORY
setopt HIST_IGNORE_ALL_DUPS
setopt HIST_IGNORE_DUPS
setopt HIST_IGNORE_SPACE
setopt HIST_EXPIRE_DUPS_FIRST
setopt HIST_REDUCE_BLANKS
setopt HIST_VERIFY

function ranger-cd {
    tempfile='/tmp/chosendir'
    /usr/bin/ranger --choosedir="$tempfile" "${@:-$(pwd)}"
    test -f "$tempfile" &&
    if [ "$(cat -- "$tempfile")" != "$(echo -n `pwd`)" ]; then
        cd -- "$(cat "$tempfile")"
    fi
    rm -f -- "$tempfile"
}

typeset -A key

key[Home]=${terminfo[khome]}
key[End]=${terminfo[kend]}
key[Insert]=${terminfo[kich1]}
key[Delete]=${terminfo[kdch1]}
key[Up]=${terminfo[kcuu1]}
key[Down]=${terminfo[kcud1]}
key[Left]=${terminfo[kcub1]}
key[Right]=${terminfo[kcuf1]}
key[PageUp]=${terminfo[kpp]}
key[PageDown]=${terminfo[knp]}

# setup key accordingly
[[ -n "${key[Home]}"     ]]  && bindkey  "${key[Home]}"     beginning-of-line
[[ -n "${key[End]}"      ]]  && bindkey  "${key[End]}"      end-of-line
[[ -n "${key[Insert]}"   ]]  && bindkey  "${key[Insert]}"   overwrite-mode
[[ -n "${key[Delete]}"   ]]  && bindkey  "${key[Delete]}"   delete-char
[[ -n "${key[Left]}"     ]]  && bindkey  "${key[Left]}"     backward-char
[[ -n "${key[Right]}"    ]]  && bindkey  "${key[Right]}"    forward-char
[[ -n "${key[PageUp]}"   ]]  && bindkey  "${key[PageUp]}"   beginning-of-buffer-or-history
[[ -n "${key[PageDown]}" ]]  && bindkey  "${key[PageDown]}" end-of-buffer-or-history
[[ -n "${key[Up]}"   ]]  && bindkey  "${key[Up]}"    history-beginning-search-backward
[[ -n "${key[Down]}" ]]  && bindkey  "${key[Down]}"  history-beginning-search-forward

# Finally, make sure the terminal is in application mode, when zle is
# active. Only then are the values from $terminfo valid.

if (( ${+terminfo[smkx]} )) && (( ${+terminfo[rmkx]} )); then
    function zle-line-init () {
        echoti smkx
    }
    function zle-line-finish () {
        echoti rmkx
    }
    zle -N zle-line-init
    zle -N zle-line-finish
fi

setopt prompt_subst
autoload -U colors && colors

function calculate_width {
    temp=" ${USER} _ ${HOST} _  _"
    dir_actual=$PWD

    if [[ "$dir_actual[0,${#HOME}]" == "$HOME" ]]
    then
        dir_actual="~$dir_actual[$((${#HOME}+1)),-1]"
    fi

    let remaining=${COLUMNS}-${#temp}
    dir_length=${#dir_actual}
    if [[ "$dir_length" -gt "$remaining" ]]
    then
        dir_actual="...${dir_actual:$(($dir_length-$remaining+3))}"
    fi
}

function ranger_level {
if [ -z "$RANGER_LEVEL" ]
then
    string_level=""
else
    string_level=" ranger │"
fi

}

reload () {
    exec "${SHELL}" "$@"
}

case $TERM in
    termite|*xterm*|rxvt|rxvt-unicode|rxvt-256color|rxvt-unicode-256color|(dt|k|E)term)
        separator1=separator2=separator3=
        precmd () {
            print -Pn "\e]0;%n@%M: %1~ \a"
            calculate_width
            tmux_sessions
            print ""
        }
        preexec () {
            print -Pn "\e]0;%n@%M %1~ ($1)\a"
        }
        ;;
    screen|screen-256color)
        separator1=separator2=separator3=
        precmd () {
            print -Pn "\e]83;title \"$1\"\a"
            print -Pn "\e]0;TMUX - %n@%M %1~\a"
            calculate_width
            tmux_sessions
            print ""
        }
        preexec () {
            print -Pn "\e]83;title \"$1\"\a"
            print -Pn "\e]0;TMUX - %n@%M %# %1~ ($1)\a"
        }
        ;;
    *)
        separator1=separator2=separator3=▒
        precmd () {
            print ""
            calculate_width
            tmux_sessions
            print ""
        }
        ;;
esac

over_ssh() {
    if [ -n "${SSH_CLIENT}" ]; then
        return 0
    else
        return 1
    fi
}

if over_ssh; then
    prompt_is_ssh="%{%K{green}%B%F{white}%} SSH %{%b%K{cyan}%F{green}%}"
else
    prompt_is_ssh="%{%b%K{cyan}%F{green}%}"
fi

if [ -n "${RANGER_LEVEL}" ]
then
    ranger_level="%{%K{cyan}%B%F{white}%} ranger %{%b%K{magenta}%F{cyan}%}"
else
    ranger_level="%{%K{magenta}%F{cyan}%}"
fi

tmux_sessions(){
    if $(tmux info &> /dev/null)
    then
        tmux_number="%{%K{magenta}%B%F{white}%} tmux: $(tmux ls | wc -l) %{%b%K{cyan}%F{magenta}%}"
    else
        tmux_number="%{%b%K{cyan}%F{magenta}%}"
    fi
}

PROMPT='%{%B%K{blue}%15F%} %n %{%b%K{green}%F{blue}%}$separator1%{%B%15F%} %m %{%b%K{cyan}%F{green}%}$separator1%{%B%15F%} $dir_actual %{%b%k%F{cyan}%}$separator1
$prompt_is_ssh$separator1 $ranger_level$separator1 $tmux_number$separator1 %{%K{cyan}%B%F{white}%}%(0?,,%{%b%K{cyan}%15F%}$separator2%{%B%F{white}%}%?)%{%b%k%F{cyan}%}$separator1%{%b%k$reset_color%} '

RPROMPT='%{%F{cyan}%}$separator3%{%B%K{cyan}%F{white}%} %@ %{%b%F{cyan}%}$separator1%{$reset_color%}'

autoload -U          edit-command-line
zle -N               edit-command-line
bindkey -M vicmd 'v' edit-command-line

setopt interactivecomments

[[ -s /home/josh/.autojump/etc/profile.d/autojump.sh ]] && source /home/josh/.autojump/etc/profile.d/autojump.sh
autoload -U compinit && compinit -u

[ -f ~/.fzf.zsh ] && source ~/.fzf.zsh

CLICK TO VIEW

x

.zsh_aliases(raw, dl)

 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
# BASH / ZSH aliases

alias whoareyou='print i am your father!'
alias color='bash -c  "$(wget -qO- https://git.io/vQgMr)"'
alias mute='amixer -D pulse set Master 1+ mute'
alias unmute='amixer -D pulse set Master 1+ unmute'
alias tmux='tmux -2'
alias sshserver='ssh josh@192.168.----'
alias sshpi='ssh pi@192.168.----'
alias ip='ifconfig'
alias wifi='nmtui'
alias zshconfig='sudo nano ~/.zshrc'
alias i3config='sudo nano ~/.config/i3/config'
alias polybarconfig='sudo nano ~/.config/polybar/config'
alias update='sudo pacman -Syu -y && yay -Syu -y'
alias ..='cd ..'
alias ...='cd ..\..'
alias cdl='cd .. && exa -lahFgb --icons --color=automatic'
alias dc='docker-compose'
alias sn='sudo nano'
alias sr='sudo reboot'
alias ss='sudo shutdown -h now'
alias find='fd'
alias diff='diff-so-fancy'
alias weather='./ansiweather'
alias own='sudo chown -R josh:josh '
alias exe='sudo chmod +x ' 

# List Files with color labels
alias l='exa -hbG --icons --color=automatic'
alias ll='exa -lahbrG@ --icons --color=automatic'
alias ls='exa --icons --color=automatic'
alias llm='exa -lbGd --sort=modified'
alias la='exa -albigmhHS --icons --color=automatic'
alias lx='exa -albigmhrHS --icons --color=automatic'

# Specialty Views
alias lS='exa -1 --icons --color=automatic'
alias lt='exa --tree --level=2'

# File Management
alias font='fc-cache -f -v'
alias x="chmod +x"
#alias vi="vim "
#alias sv="sudo vim "
alias pgrep="ps aux | grep"
alias grep="grep --color=auto"
alias mkdir="mkdir -pv"
alias cp='cp -iv -r'
alias mv="mv -iv"
alias rm="rm -Iv"
alias enable_vbox='sudo modprobe vboxdrv vboxnetadp vboxnetflt vboxpci'
alias disable_vbox='sudo modprobe -r vboxdrv vboxnetadp vboxnetflt vboxpci'
alias speed_test='wget -O /dev/null http://speedtest.wdc01.softlayer.com/downloads/test10.zip'
alias mpd_start='systemctl start mpd.service mpdscribble.service --user'
alias mpd_stop='systemctl stop mpd.service mpdscribble.service --user'

# Terminal Programs
alias ym="youtube-dl xic --audio-format mp3 --add-metadata "
alias yt="youtube-dl xic --add-metadata "
alias pingg="hostname -I && curl ipinfo.io/ip && ping -c 5 -q google.com"
alias xclip="xclip -selection clipboard"
 

x

Notes

this config was stolen borrowed from Sergio (http://dotshare.it/dots/1023/) gotta give credit where credit is due because i think the original config is amazing. I just made a few small tweaks here and there to fit my style, oh and its in english too! lol. the color scheme on top is called Sea Shells from this repo (https://github.com/Mayccoll/Gogh) I use that mainly, i just showed off the others for contrast. the middle color scheme is gruvbox dark and the bottom is called wryan.

https://github.com/cmdywrtr27
- still a work in progress, a few useful things in there though