├── .gitmodules ├── .zshrc ├── README.md └── aliasrc /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "pure"] 2 | path = pure 3 | url = https://github.com/sindresorhus/pure.git 4 | -------------------------------------------------------------------------------- /.zshrc: -------------------------------------------------------------------------------- 1 | # Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc. 2 | # Initialization code that may require console input (password prompts, [y/n] 3 | # confirmations, etc.) must go above this block; everything else may go below. 4 | if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then 5 | source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" 6 | fi 7 | 8 | # Dependencies You Need for this Config 9 | # zsh-syntax-highlighting - syntax highlighting for ZSH in standard repos 10 | # autojump - jump to directories with j or jc for child or jo to open in file manager 11 | # zsh-autosuggestions - Suggestions based on your history 12 | 13 | # Initial Setup 14 | # touch "$HOME/.cache/zshhistory 15 | # Setup Alias in $HOME/zsh/aliasrc 16 | # git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k 17 | # echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >>! ~/.zshrc 18 | 19 | # Enable colors and change prompt: 20 | autoload -U colors && colors 21 | PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b " 22 | 23 | # Custom Variables 24 | EDITOR=vim 25 | 26 | # History in cache directory: 27 | HISTSIZE=10000 28 | SAVEHIST=10000 29 | HISTFILE=~/.cache/zshhistory 30 | setopt appendhistory 31 | 32 | # Basic auto/tab complete: 33 | autoload -U compinit 34 | zstyle ':completion:*' menu select 35 | zmodload zsh/complist 36 | compinit 37 | _comp_options+=(globdots) # Include hidden files. 38 | 39 | # Custom ZSH Binds 40 | bindkey '^ ' autosuggest-accept 41 | 42 | # Load aliases and shortcuts if existent. 43 | [ -f "$HOME/zsh/aliasrc" ] && source "$HOME/zsh/aliasrc" 44 | 45 | # Load ; should be last. 46 | source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh 2>/dev/null 47 | source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh 2>/dev/null 48 | source /usr/share/autojump/autojump.zsh 2>/dev/null 49 | source ~/powerlevel10k/powerlevel10k.zsh-theme 50 | 51 | # To customize prompt, run `p10k configure` or edit ~/.p10k.zsh. 52 | [[ ! -f ~/.p10k.zsh ]] || source ~/.p10k.zsh 53 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # zsh 2 | 3 | My ZSH Config 4 | 5 | ## Setup 6 | 7 | ``` 8 | touch "$HOME/.cache/zshhistory" 9 | #-- Setup Alias in $HOME/zsh/aliasrc 10 | git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ~/powerlevel10k 11 | echo 'source ~/powerlevel10k/powerlevel10k.zsh-theme' >> ~/.zshrc 12 | ``` 13 | 14 | ## Get Dependencies 15 | 16 | - zsh-syntax-highlighting - syntax highlighting for ZSH in standard repos 17 | - autojump - jump to directories with j or jc for child or jo to open in file manager 18 | - zsh-autosuggestions - Suggestions based on your history 19 | 20 | ### Debian Dependencies 21 | 22 | ```bash 23 | sudo apt install zsh-syntax-highlighting autojump zsh-autosuggestions 24 | ``` 25 | 26 | ### Arch Dependencies 27 | 28 | ```bash 29 | yay -S zsh-syntax-highlighting autojump zsh-autosuggestions 30 | ``` 31 | 32 | Finish the conversion by changing your user in /etc/passwd to /bin/zsh instead of /bin/bash 33 | 34 | or typing `chsh $USER` and entering `/bin/zsh` 35 | -------------------------------------------------------------------------------- /aliasrc: -------------------------------------------------------------------------------- 1 | # 2 | # # ex - archive extractor 3 | # # usage: ex 4 | ex () 5 | { 6 | if [ -f $1 ] ; then 7 | case $1 in 8 | *.tar.bz2) tar xjf $1 ;; 9 | *.tar.gz) tar xzf $1 ;; 10 | *.tar.xz) tar xJf $1 ;; 11 | *.bz2) bunzip2 $1 ;; 12 | *.rar) unrar x $1 ;; 13 | *.gz) gunzip $1 ;; 14 | *.tar) tar xf $1 ;; 15 | *.tbz2) tar xjf $1 ;; 16 | *.tgz) tar xzf $1 ;; 17 | *.zip) unzip $1 ;; 18 | *.Z) uncompress $1;; 19 | *.7z) 7z x $1 ;; 20 | *) echo "'$1' cannot be extracted via ex()" ;; 21 | esac 22 | else 23 | echo "'$1' is not a valid file" 24 | fi 25 | } 26 | 27 | export EDITOR=vim 28 | 29 | alias pacman-update='sudo pacman-mirrors --geoip' 30 | 31 | alias ls='ls' 32 | alias ll='ls -l' 33 | # ls, the common ones I use a lot shortened for rapid fire usage 34 | alias l='ls -lFh' #size,show type,human readable 35 | alias la='ls -lAFh' #long list,show almost all,show type,human readable 36 | alias lr='ls -tRFh' #sorted by date,recursive,show type,human readable 37 | alias lt='ls -ltFh' #long list,sorted by date,show type,human readable 38 | alias ll='ls -l' #long list 39 | alias ldot='ls -ld .*' 40 | alias lS='ls -1FSsh' 41 | alias lart='ls -1Fcart' 42 | alias lrt='ls -1Fcrt' 43 | 44 | alias zshrc='${=EDITOR} ~/.zshrc' # Quick access to the ~/.zshrc file 45 | 46 | alias grep='grep --color' 47 | alias sgrep='grep -R -n -H -C 5 --exclude-dir={.git,.svn,CVS} ' 48 | 49 | alias t='tail -f' 50 | 51 | # Command line head / tail shortcuts 52 | alias -g H='| head' 53 | alias -g T='| tail' 54 | alias -g G='| grep' 55 | alias -g L="| less" 56 | alias -g M="| most" 57 | alias -g LL="2>&1 | less" 58 | alias -g CA="2>&1 | cat -A" 59 | alias -g NE="2> /dev/null" 60 | alias -g NUL="> /dev/null 2>&1" 61 | alias -g P="2>&1| pygmentize -l pytb" 62 | 63 | alias dud='du -d 1 -h' 64 | alias duf='du -sh *' 65 | alias fd='find . -type d -name' 66 | alias ff='find . -type f -name' 67 | 68 | alias h='history' 69 | alias hgrep="fc -El 0 | grep" 70 | alias help='man' 71 | alias p='ps -f' 72 | alias sortnr='sort -n -r' 73 | alias unexport='unset' 74 | 75 | alias rm='rm -i' 76 | alias cp='cp -i' 77 | alias mv='mv -i' 78 | alias vim='vim' 79 | alias vi='vim' 80 | alias gds-start='sudo systemctl start openvpn-client@gds' 81 | alias gds-stop='sudo systemctl stop openvpn-client@gds' 82 | gitpush() { 83 | git add . 84 | git commit -m "$*" 85 | git pull 86 | git push 87 | } 88 | gitupdate() { 89 | eval "$(ssh-agent -s)" 90 | ssh-add ~/.ssh/github 91 | ssh -T git@github.com 92 | } 93 | alias gp=gitpush 94 | alias gu=gitupdate 95 | alias lbrynet='/opt/LBRY/resources/static/daemon/lbrynet' 96 | alias update-grub='sudo grub-mkconfig -o /boot/grub/grub.cfg' 97 | --------------------------------------------------------------------------------