SHELL – ZSH , Powerlevel9k, Tmux , CCZE

  shell

SHELL : ZSH – Powerlevel9k – TMUX – CCZE

apt install zsh tmux ccze vim git curl

# Zsh
chsh -s /bin/zsh
/bin/zsh

# Powerlevel9k
sh -c "$(wget https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k

# Nerd Fonts
git clone https://github.com/ryanoasis/nerd-fonts.git
cd nerd-fonts && sudo ./install.sh

# Tmux 
git clone https://github.com/jimeh/tmux-themepack.git ~/.tmux-themepack 
cd ~/ && vim .tmux.conf (Cf. code ci-dessous)
#.zshrc
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_MODE="nerdfont-complete"
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR=
# .tmux.conf
#
# By yishan
#

# theme
source-file "${HOME}/.tmux-themepack/powerline/block/blue.tmuxtheme"

#shell
set-option -g default-shell /usr/bin/zsh

#Set 256-colour terminal
set -g default-terminal "screen-256color"

# Number of lines held in window history
set -g history-limit 1000

# Change the prefix key to C-a
set -g prefix C-a
unbind C-b
bind C-a send-prefix

# Mouse
set -g mouse on

# Reload Conf
unbind r
bind r source-file ~/.tmux.conf; display "Reloaded"

# Some extra key bindings to select higher numbered windows
bind F1 selectw -t:10
bind F2 selectw -t:11
bind F3 selectw -t:12
bind F4 selectw -t:13
bind F5 selectw -t:14
bind F6 selectw -t:15
bind F7 selectw -t:16
bind F8 selectw -t:17
bind F9 selectw -t:18
bind F10 selectw -t:19

# Set window notifications
setw -g monitor-activity on
set -g visual-activity on

# Automatically set window title
setw -g automatic-rename on

# Mode-keys style for copy mode
setw -g mode-keys vi

# Navigation entre les fenêtres avec ctrl + flêches 
bind-key -n C-right next
bind-key -n C-left prev
# .zshrc - Arch

####################################################### 
########### Theme oh-my-zsh ###################
#######################################################
export ZSH=/home/yishan/.oh-my-zsh
ZSH_THEME="powerlevel9k/powerlevel9k"
POWERLEVEL9K_MODE='nerdfont-complete'
POWERLEVEL9K_MODE='nerdfont-complete'
POWERLEVEL9K_LEFT_SEGMENT_SEPARATOR=
\uE0C0'
POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR=


\uE0C2' POWERLEVEL9K_STATUS_VERBOSE=true POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context dir vcs root_indicator) POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status time background_jobs load virtualenv) POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 POWERLEVEL9K_OS_ICON_BACKGROUND="blue" POWERLEVEL9K_OS_ICON_FOREGROUND="black" POWERLEVEL9K_DIR_HOME_BACKGROUND="black" POWERLEVEL9K_DIR_HOME_FOREGROUND="white" POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND="blue" POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="black" POWERLEVEL9K_DIR_DEFAULT_BACKGROUND="green" POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="black" if [ "$USER" != "root" ]; then export DEFAULT_USER="$USER" fi ############## # Mes Aliases # ############### # Apt-get alias maj='sudo apt update && sudo apt upgrade && sudo apt dist-upgrade' alias up='sudo apt update' alias install='sudo apt install' alias autoremove='sudo apt autoremove' alias autoclean='sudo apt autoclean' alias cache='sudo apt search' # Moves alias cddl="cd ~/Téléchargements" alias cl='clear' alias ll='ls -la' # Network alias ip="dig +short myip.opendns.com @resolver1.opendns.com" # Archives alias ntar="tar -cf" alias gz="tar -zcvf" alias bz="tar -jcvf" alias zp="zip" alias ugz="tar -zxf" alias ubz="tar -jxf" alias utar="tar -xf" alias uzp="unzip" alias ltar="tar -tf" alias lbz="tar -jtf" alias lgz="tar -ztf" alias lzp="unzip -l" alias llz="tar --lzma -tf" alias ulz="tar --lzma -xf" alias lz="tar --lzma -cvf" #logs alias syslog="tail -f /var/log/syslog | ccze -A" # Files search ## fichiers modifiés dans les 48h alias modifies="find . -mtime -1 -print | more"


\uE0C0' POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR= \uE0C0' POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR=


\uE0C2' POWERLEVEL9K_STATUS_VERBOSE=true POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context dir vcs root_indicator) POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status time background_jobs load virtualenv) POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 POWERLEVEL9K_OS_ICON_BACKGROUND="blue" POWERLEVEL9K_OS_ICON_FOREGROUND="black" POWERLEVEL9K_DIR_HOME_BACKGROUND="black" POWERLEVEL9K_DIR_HOME_FOREGROUND="white" POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND="blue" POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="black" POWERLEVEL9K_DIR_DEFAULT_BACKGROUND="green" POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="black" if [ "$USER" != "root" ]; then export DEFAULT_USER="$USER" fi ############## # Mes Aliases # ############### # Apt-get alias maj='sudo apt update && sudo apt upgrade && sudo apt dist-upgrade' alias up='sudo apt update' alias install='sudo apt install' alias autoremove='sudo apt autoremove' alias autoclean='sudo apt autoclean' alias cache='sudo apt search' # Moves alias cddl="cd ~/Téléchargements" alias cl='clear' alias ll='ls -la' # Network alias ip="dig +short myip.opendns.com @resolver1.opendns.com" # Archives alias ntar="tar -cf" alias gz="tar -zcvf" alias bz="tar -jcvf" alias zp="zip" alias ugz="tar -zxf" alias ubz="tar -jxf" alias utar="tar -xf" alias uzp="unzip" alias ltar="tar -tf" alias lbz="tar -jtf" alias lgz="tar -ztf" alias lzp="unzip -l" alias llz="tar --lzma -tf" alias ulz="tar --lzma -xf" alias lz="tar --lzma -cvf" #logs alias syslog="tail -f /var/log/syslog | ccze -A" # Files search ## fichiers modifiés dans les 48h alias modifies="find . -mtime -1 -print | more"


\uE0C2′ POWERLEVEL9K_STATUS_VERBOSE=true POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context dir vcs root_indicator) POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status time background_jobs load virtualenv) POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 POWERLEVEL9K_OS_ICON_BACKGROUND= »blue » POWERLEVEL9K_OS_ICON_FOREGROUND= »black » POWERLEVEL9K_DIR_HOME_BACKGROUND= »black » POWERLEVEL9K_DIR_HOME_FOREGROUND= »white » POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND= »blue » POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND= »black » POWERLEVEL9K_DIR_DEFAULT_BACKGROUND= »green » POWERLEVEL9K_DIR_DEFAULT_FOREGROUND= »black » if [ « $USER » != « root » ]; then export DEFAULT_USER= »$USER » fi plugins=( git ) source $ZSH/oh-my-zsh.sh source /usr/share/zsh/plugins/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh ####################################################### ######### Locales ####################### ####################################################### export LANG=fr_FR-UTF-8 export LANGUAGE=fr_FR.UTF-8 export LC_ALL=fr_FR.UTF-8 ####################################################### ######## ZSH options ########## ####################################################### setopt INC_APPEND_HISTORY SHARE_HISTORY setopt APPEND_HISTORY unsetopt BG_NICE setopt CORRECT setopt EXTENDED_HISTORY setopt MENUCOMPLETE setopt ALL_EXPORT ###################################################### ### shell options ############## ###################################################### setopt notify globdots correct pushdtohome cdablevars autolist setopt correctall autocd recexact longlistjobs setopt autoresume histignoredups pushdsilent setopt autopushd pushdminus extendedglob rcquotes mailwarning unsetopt bgnice autoparamslash ##################################################### ### Autoload zsh modules when they are referenced ## ##################################################### autoload -U history-search-end zmodload -a zsh/stat stat zmodload -a zsh/zpty zpty zmodload -a zsh/zprof zprof zle -N history-beginning-search-backward-end history-search-end zle -N history-beginning-search-forward-end history-search-end ##################################################### ############# variables ########## ##################################################### PATH= »/usr/local/bin:/usr/local/sbin/:$PATH » HISTFILE=$HOME/.zhistory HISTSIZE=1000 SAVEHIST=1000 HOSTNAME= »`hostname` » LS_COLORS=’rs=0:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:su=37;41:sg=30;43:tw=30;42:ow=34;42:st=37;44:ex=01;32:’; ##################################################### ######### Load colors ######### ##################################################### autoload colors zsh/terminfo if [[ « $terminfo[colors] » -ge 8 ]]; then colors fi for color in RED GREEN YELLOW BLUE MAGENTA CYAN WHITE; do eval PR_$color=’%{$terminfo[bold]$fg[${(L)color}]%}’ eval PR_LIGHT_$color=’%{$fg[${(L)color}]%}’ (( count = $count + 1 )) done unsetopt ALL_EXPORT ###################################################### ############## alias ############## ###################################################### alias ll=’ls -al’ alias ls=’ls –color=auto ‘ alias sshdedie= » ###################################################### ############## Bind keys ############## ###################################################### autoload -U compinit compinit bindkey « ^? » backward-delete-char bindkey ‘^[OH’ beginning-of-line bindkey ‘^[OF’ end-of-line bindkey ‘^[[5~’ up-line-or-history bindkey ‘^[[6~’ down-line-or-history bindkey « ^[[A » history-beginning-search-backward-end bindkey « ^[[B » history-beginning-search-forward-end bindkey « ^r » history-incremental-search-backward bindkey ‘ ‘ magic-space # also do history expansion on space bindkey ‘^I’ complete-word # complete on tab, leave expansion to _expand zstyle ‘:completion::complete:*’ use-cache on zstyle ‘:completion::complete:*’ cache-path ~/.zsh/cache/$HOST zstyle ‘:completion:*’ list-colors ${(s.:.)LS_COLORS} zstyle ‘:completion:*’ list-prompt ‘%SAt %p: Hit TAB for more, or the character to insert%s’ zstyle ‘:completion:*’ menu select=1 _complete _ignored _approximate zstyle -e ‘:completion:*:approximate:*’ max-errors \ ‘reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )’ zstyle ‘:completion:*’ select-prompt ‘%SScrolling active: current selection at %p%s’ # Completion Styles # list of completers to use zstyle ‘:completion:*::::’ completer _expand _complete _ignored _approximate # allow one error for every three characters typed in approximate completer zstyle -e ‘:completion:*:approximate:*’ max-errors \ ‘reply=( $(( ($#PREFIX+$#SUFFIX)/2 )) numeric )’ # insert all expansions for expand completer zstyle ‘:completion:*:expand:*’ tag-order all-expansions # formatting and messages zstyle ‘:completion:*’ verbose yes zstyle ‘:completion:*:descriptions’ format ‘%B%d%b’ zstyle ‘:completion:*:messages’ format ‘%d’ zstyle ‘:completion:*:warnings’ format ‘No matches for: %d’ zstyle ‘:completion:*:corrections’ format ‘%B%d (errors: %e)%b’ zstyle ‘:completion:*’ group-name  » # match uppercase from lowercase zstyle ‘:completion:*’ matcher-list ‘m:{a-z}={A-Z}’ # offer indexes before parameters in subscripts zstyle ‘:completion:*:*:-subscript-:*’ tag-order indexes parameters # command for process lists, the local web server details and host completion # on processes completion complete all user processes zstyle ‘:completion:*:processes’ command ‘ps -au$USER’ ## add colors to processes for kill completion zstyle ‘:completion:*:*:kill:*:processes’ list-colors ‘=(#b) #([0-9]#)*=0=01;31’ #zstyle ‘:completion:*:processes’ command ‘ps -o pid,s,nice,stime,args’ #zstyle ‘:completion:*:urls’ local ‘www’ ‘/var/www/htdocs’ ‘public_html’ # #NEW completion: # 1. All /etc/hosts hostnames are in autocomplete # 2. If you have a comment in /etc/hosts like #%foobar.domain, # then foobar.domain will show up in autocomplete! zstyle ‘:completion:*’ hosts $(awk ‘/^[^#]/ {print $2 $3″ « $4 » « $5}’ /etc/hosts | grep -v ip6- && grep « ^#% » /etc/hosts | awk -F% ‘{print $2}’) # Filename suffixes to ignore during completion (except after rm command) zstyle ‘:completion:*:*:(^rm):*:*files’ ignored-patterns ‘*?.o’ ‘*?.c~’ \ ‘*?.old’ ‘*?.pro’ # the same for old style completion #fignore=(.o .c~ .old .pro) # ignore completion functions (until the _ignored completer) zstyle ‘:completion:*:functions’ ignored-patterns ‘_*’ zstyle ‘:completion:*:*:*:users’ ignored-patterns \ adm apache bin daemon games gdm halt ident junkbust lp mail mailnull \ named news nfsnobody nobody nscd ntp operator pcap postgres radvd \ rpc rpcuser rpm shutdown squid sshd sync uucp vcsa xfs avahi-autoipd\ avahi backup messagebus beagleindex debian-tor dhcp dnsmasq fetchmail\ firebird gnats haldaemon hplip irc klog list man cupsys postfix\ proxy syslog www-data mldonkey sys snort # SSH Completion zstyle ‘:completion:*:scp:*’ tag-order \ files users ‘hosts:-host hosts:-domain:domain hosts:-ipaddr »IP\ Address *’ zstyle ‘:completion:*:scp:*’ group-order \ files all-files users hosts-domain hosts-host hosts-ipaddr zstyle ‘:completion:*:ssh:*’ tag-order \ users ‘hosts:-host hosts:-domain:domain hosts:-ipaddr »IP\ Address *’ zstyle ‘:completion:*:ssh:*’ group-order \ hosts-domain hosts-host users hosts-ipaddr zstyle ‘*’ single-ignored show \uE0C0′ POWERLEVEL9K_RIGHT_SEGMENT_SEPARATOR=



\uE0C2′ POWERLEVEL9K_STATUS_VERBOSE=true POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon context dir vcs root_indicator) POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status time background_jobs load virtualenv) POWERLEVEL9K_SHORTEN_DIR_LENGTH=2 POWERLEVEL9K_OS_ICON_BACKGROUND= »blue » POWERLEVEL9K_OS_ICON_FOREGROUND= »black » POWERLEVEL9K_DIR_HOME_BACKGROUND= »black » POWERLEVEL9K_DIR_HOME_FOREGROUND= »white » POWERLEVEL9K_DIR_HOME_SUBFOLDER_BACKGROUND= »blue » POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND= »black » POWERLEVEL9K_DIR_DEFAULT_BACKGROUND= »green » POWERLEVEL9K_DIR_DEFAULT_FOREGROUND= »black » if [ « $USER » != « root » ]; then export DEFAULT_USER= »$USER » fi ############## # Mes Aliases # ############### # Apt-get alias maj=’sudo apt update && sudo apt upgrade && sudo apt dist-upgrade’ alias up=’sudo apt update’ alias install=’sudo apt install’ alias autoremove=’sudo apt autoremove’ alias autoclean=’sudo apt autoclean’ alias cache=’sudo apt search’ # Moves alias cddl= »cd ~/Téléchargements » alias cl=’clear’ alias ll=’ls -la’ # Network alias ip= »dig +short myip.opendns.com @resolver1.opendns.com » # Archives alias ntar= »tar -cf » alias gz= »tar -zcvf » alias bz= »tar -jcvf » alias zp= »zip » alias ugz= »tar -zxf » alias ubz= »tar -jxf » alias utar= »tar -xf » alias uzp= »unzip » alias ltar= »tar -tf » alias lbz= »tar -jtf » alias lgz= »tar -ztf » alias lzp= »unzip -l » alias llz= »tar –lzma -tf » alias ulz= »tar –lzma -xf » alias lz= »tar –lzma -cvf » #logs alias syslog= »tail -f /var/log/syslog | ccze -A » # Files search ## fichiers modifiés dans les 48h alias modifies= »find . -mtime -1 -print | more »