logo

dotfiles

My dotfiles, one branch per machine
commit: 7ff0cd29cbf0b11894822248e8fcb0b50765a0b8
parent: 7928001c588bd354325fa4a6c360850262326481
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed, 16 Mar 2016 13:07:16 +0100

Modifications to shells run-config

Diffstat:

M.bashrc25+------------------------
M.common.sh56+++++++++++++++++++++++++++++++++++---------------------
A.mkshrc1+
M.zshrc44++++++++++----------------------------------
4 files changed, 47 insertions(+), 79 deletions(-)

diff --git a/.bashrc b/.bashrc @@ -1,26 +1,3 @@ source ~/.common.sh -color_prompt=yes -force_color_prompt=yes - -precmd() { - local branch - if branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null); then - if [[ "$branch" == "HEAD" ]]; then - branch='detached*' - fi - git_branch="($branch)" - else - git_branch="" - fi -} - -case "$TERM" in - "xterm") - PS1="\033]0;\u@\h\W\007\[\e[31m\]\u\[\e[36m\]@\H\[\e[32m\]\w\[\e[33m\]\[\$git_branch\]\[\e[32m\]\$\[\e[0m\] " - ;; - *) - PS1="\[\e[31m\]\u\[\e[36m\]@\H\[\e[32m\]\w\[\e[33m\]\[\$git_branch\]\[\e[32m\]\$\[\e[0m\] " - ;; -esac -#PS1="\033]0;\u@\h\W\007\[\e[31m\]\u\[\e[36m\]@\H\[\e[32m\]\w\[\e[33m\]\[\$git_branch\]\[\e[32m\]\$\[\e[0m\] " +set -o vi diff --git a/.common.sh b/.common.sh @@ -1,17 +1,42 @@ +# functions +get_git_branch() { + local branch + if branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null); then + if [[ "$branch" == "HEAD" ]]; then + branch='detached*' + fi + printf -- ' %s' "$branch" + else + echo '' + fi +} + # exports -export EDITOR='/usr/bin/vim' -export NNTPSERVER='news.free.fr' # USENET server +export DVTM_EDITOR=`which vis` +export EDITOR=`which vim` export GPGKEY='4BBEBBAD' -export PI='3.141592653589793' -export TZ='Europe/Berlin' +export HISTFILE="$HOME/.$(basename $SHELL)_history" +export HISTSIZE="65536" export LANG='en_US.UTF-8' -#export GTK_IM_MODULE="xim" -#export QT_IM_MODULE="xim" -#export XMODIFIERS="@im=XIM" -export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/games/bin:/usr/local/bin:/usr/local/sbin:/usr/local/inferno/Linux/386/bin:~/.local/bin" +export LC_TIME='POSIX' +export LESS="-M -r" +export NNTPSERVER='news.free.fr' +export PAGER=`which less` +export PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/bin/X11:/usr/games/bin:/usr/local/bin:/usr/local/sbin:/usr/local/inferno/Linux/386/bin:/opt/bin" +export PATH="$PATH:$HOME/.local/bin:$HOME/nalci\ finpe/bin:" +export LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.pdf=00;32:*.ps=00;32:*.txt=00;32:*.patch=00;32:*.diff=00;32:*.log=00;32:*.tex=00;32:*.doc=00;32:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.axa=00;36:*.oga=00;36:*.spx=00;36:*.xspf=00;36:' +export PS1='$USER@$(hostname)$PWD$(get_git_branch) ' +export QT_STYLE_OVERRIDE=GTK+ +export TERMINAL='st' +export TZ='Europe/Berlin' +export VIS_THEME=default-16 + +# Freedesktop shit +export XDG_DOWNLOAD_DIR="$HOME/Downloads" +export XDG_DESKTOP_DIR="/dev/null" # Aliases -alias git-history="git log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(cyan)%h%C(reset)%C(green)(%ar)%C(reset)%s %C(red)- %an %C(reset)%C(yellow)%d%C(reset)' --all" +alias git-history="git log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(cyan)%h%C(reset) %C(green)(%ar)%C(reset) %G?: %s %C(red)- %an %C(reset)%C(yellow)%d%C(reset)' --all" alias ll='ls -alhF' alias la='ls -ahF' alias ls='ls -hF' @@ -19,15 +44,4 @@ alias j='jobs -l' alias mv='mv -i' alias psmem='ps -eo pid,user,pcpu,pmem,comm --sort -pmem | head -20' alias pscpu='ps -eo pid,user,pcpu,pmem,comm --sort -pcpu | head -20' - -# Add gpg-agent for ssh -export GPG_TTY=$(tty) -if [ -f ~/.cache/gpg-agent-info ]; then - . ~/.cache/gpg-agent-info - export GPG_AGENT_INFO - export SSH_AUTH_SOCK -fi - -# Freedesktop shit -export XDG_DOWNLOAD_DIR="~/Downloads" # That should second trash directory be default anyway -export XDG_DESKTOP_DIR="/dev/null" # I don’t want shit for desktop, I don’t have one +alias fuck='TF_ALIAS=fuck eval $(thefuck $(fc -ln -1))' diff --git a/.mkshrc b/.mkshrc @@ -0,0 +1 @@ +source ~/.common.sh diff --git a/.zshrc b/.zshrc @@ -7,44 +7,20 @@ setopt bash_auto_list unsetopt monitor -precmd() { - local branch - if branch=$(git rev-parse --abbrev-ref HEAD 2> /dev/null); then - if [[ "$branch" == "HEAD" ]]; then - branch='detached*' - fi - git_branch="($branch)" - else - git_branch='' - fi -} - -case "$TERM" in - "xterm*"|"*rxvt*") - PS1=$'%{\e]0;%n@%m:%~\a%}%{\e[0;32m%}%n%{\e[0;36m%}@%M%{\e[0;33m%}%~%{\e[0;35m%}${git_branch}%{\e[0;32m%}%#%{\e[0m%} ' - ;; - "screen*") - PS1=$'%{\e]0;[${STY}]\a%}%{\e[0;32m%}%n%{\e[0;36m%}@%M%{\e[0;33m%}%~%{\e[0;35m%}${git_branch}%{\e[0;32m%}%#%{\e[0m%} ' - ;; - *) - PS1=$'%{\e[0;32m%}%n%{\e[0;36m%}@%M%{\e[0;33m%}%~%{\e[0;35m%}${git_branch}%{\e[0;32m%}%#%{\e[0m%} ' - ;; -esac -RPS1=$'%?|%T' -# old bash prompt: PS1=$'\e[0;31m%n\e[0;36m@%M\e[0;32m%~%#\e[0m ' - -# History -setopt inc_append_history -setopt hist_reduce_blanks -export HISTSIZE=1000 -export SAVEHIST=1000 -export HISTFILE=~/.history - # Completion zstyle ':completion:*' completer _expand _complete _ignored zstyle ':completion:*' matcher-list '' 'r:|[._-]=* r:|=*' 'm:{[:lower:][:upper:]}={[:upper:][:lower:]}' zstyle ':completion:*' squeeze-slashes true zstyle ':completion:*' use-ip true #ssh completion +zstyle ':completion::complete:*' use-cache 1 -autoload -Uz compinit +autoload -U compinit promptinit compinit +promptinit; prompt gentoo + +RPS1=$'%?|%T' + +# History +setopt inc_append_history +setopt hist_reduce_blanks +setopt HIST_IGNORE_DUPS