Browse Source

First commit

Emmanuel Bouthenot 9 years ago
commit
f4faba1b85
16 changed files with 769 additions and 0 deletions
  1. 6 0
      .gitmodules
  2. 38 0
      tools/git/.gitconfig
  3. 1 0
      tools/git/gitconfig
  4. 70 0
      tools/tmux/tmux.conf
  5. 6 0
      tools/vim/vimpagerrc
  6. 264 0
      tools/vim/vimrc
  7. 1 0
      tools/vimpager
  8. 3 0
      tools/web/chroot-wrapper
  9. 1 0
      tools/web/compass
  10. 1 0
      tools/web/grunt
  11. 1 0
      tools/web/sass
  12. 1 0
      zsh/.zprezto
  13. 1 0
      zsh/.zpreztorc
  14. 1 0
      zsh/prezto
  15. 154 0
      zsh/zpreztorc
  16. 220 0
      zsh/zshrc

+ 6 - 0
.gitmodules

@@ -0,0 +1,6 @@
+[submodule "tools/vimpager"]
+	path = tools/vimpager
+	url = https://github.com/rkitover/vimpager.git
+[submodule "zsh/prezto"]
+	path = zsh/prezto
+	url = https://github.com/sorin-ionescu/prezto.git

+ 38 - 0
tools/git/.gitconfig

@@ -0,0 +1,38 @@
+[alias]
+    br = branch
+    st = status
+    s = status --untracked-files=no
+    sa = status --untracked-files=all
+    d = diff
+    dh = diff HEAD
+    dc = diff --cached
+    ci = commit
+    co = checkout
+    l = ! export LESS=-R GIT_PAGER=less && git log --graph --decorate --pretty=format:\"%h %C(magenta)%ci%Creset%C(yellow)%d %Creset%s %C(cyan)%cn <%cE>\"
+    ls = ls-files
+    ign = ls-files -o -i --exclude-standard
+    unstage = reset HEAD
+    sinit = ! git submodule init && git submodule update && git submodule foreach 'git checkout master'
+    spull = submodule foreach 'git pull'
+
+[color]
+    ui = auto
+    pager = false
+
+[color "diff"]
+    meta = green
+    frag = yellow
+    old = magenta
+    new = cyan
+
+[color "status"]
+    header = bold blue
+    added  = green
+    changed = bold red
+    untracked = white
+
+[merge]
+    tool = vimdiff
+
+[pager]
+    diff = true

+ 1 - 0
tools/git/gitconfig

@@ -0,0 +1 @@
+.gitconfig

+ 70 - 0
tools/tmux/tmux.conf

@@ -0,0 +1,70 @@
+# -*- tmux.conf -*-
+
+### Global settings ###
+#
+# terminal type, history size, env
+#
+set -g default-terminal "screen-256color"
+set -g xterm-keys on
+set -g history-limit 102400
+setw -g aggressive-resize on
+set -g update-environment "DISPLAY WINDOWID SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"
+#set -g terminal-overrides 'xterm*:smcup@:rmcup@'
+setw -g mode-mouse off
+
+### Backport some “screen” setting ###
+#
+# the magic key is Ctrl-a instead of Ctrl-b (the default)
+#
+unbind C-b
+unbind l
+set -g prefix C-a
+
+#
+# Ctrl-a Ctrl-a jump to the previous window
+#
+bind-key C-a last-window
+
+### Some shortcuts ###
+#
+# quickly reload config file
+#
+bind r source-file ~/.tmux.conf
+#
+# killing the window
+#
+bind k confirm-before kill-window
+#
+# Ctrl-a a, useful for the $SHELL
+#
+bind a send-prefix
+#
+# splitting the windows
+#
+bind h split-window
+bind v split-window -h
+#
+# enter copy mode
+#
+unbind [
+bind * copy-mode
+
+### Decoration settings ###
+#
+# some colors
+#
+set -g status-bg black
+set -g status-fg white
+#set -g set-titles-string '#H #S #I #P #W #T' # window number,program name,active (or not)
+set-window-option -g window-status-current-fg red
+set-window-option -g window-status-current-bg default
+#
+# status bar settings
+#
+set -g status-interval 60
+set -g status-left '#[fg=green]#(hostname)#[default] '
+set -g status-right "#[fg=yellow]up: #(uptime|cut -d ' ' -f 4-| sed 's/ days, /d,/ ; s/ load average: /load: /')#[default] #[fg=green]%H:%M %d-%m-%Y#[default] (#S)"
+set -g status-right-length 70
+
+### Decoration settings ###
+

+ 6 - 0
tools/vim/vimpagerrc

@@ -0,0 +1,6 @@
+"
+" Vimpager configuration file
+"
+
+set viminfo="NONE"
+

+ 264 - 0
tools/vim/vimrc

@@ -0,0 +1,264 @@
+"
+" Vim configuration file
+"
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Useful functions
+"
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+function! CleanClose()
+    let todelbufNr = bufnr("%")
+    let newbufNr = bufnr("#")
+    if ((newbufNr != -1) && (newbufNr != todelbufNr) && buflisted(newbufNr))
+        exe "b".newbufNr
+    else
+        bnext
+    endif
+    if (bufnr("%") == todelbufNr)
+        new
+    endif
+    exe "bd".todelbufNr
+endfunction
+
+function! GetFileSize()
+    let size = ''
+    let bytes = getfsize(expand('%:p'))
+    if bytes <= 1024
+        let size = bytes . 'B'
+    elseif bytes <= 1048576
+        let size = (bytes / 1024) . 'KB'
+    elseif bytes <= (1073741824)
+        let size = (bytes / 1048576) . 'MB'
+    elseif bytes <= 1099511627776
+        let size = (bytes / 1073741824) . 'GB'
+    elseif bytes <= 1125899906842624
+        let size = (bytes / 1099511627776) . 'TB'
+  endif
+    return size
+endfunction
+
+function! GetMode()
+    let curmode = mode()
+    let mode = curmode
+    if curmode == 'n'
+        let mode = 'NORMAL'
+    elseif curmode == 'i'
+        let mode = 'INSERT'
+    elseif curmode == 'R'
+        let mode = 'REPLACE'
+    elseif curmode == 'v'
+        let mode = 'VISUAL'
+    elseif curmode == 'V'
+        if has("multi_byte")
+            let mode = 'V⋅LINE'
+        else
+            let mode = 'VLINE'
+        endif
+    elseif curmode == 'V'
+        if has("multi_byte")
+            let mode = 'V⋅BLOC'
+        else
+            let mode = 'VBLOC'
+        endif
+    endif
+    return mode
+endfunction
+
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" General Settings
+"
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+"Term settings (under tmux)
+if &term =~ '^screen'
+    "tmux will send xterm-style keys when its xterm-keys option is on
+    execute "set <xUp>=\e[1;*A"
+    execute "set <xDown>=\e[1;*B"
+    execute "set <xRight>=\e[1;*C"
+    execute "set <xLeft>=\e[1;*D"
+endif
+
+set nocompatible "no vi compatibility
+set history=200 "command history size
+set undolevels=120 "undo levels count
+
+set autoread "notify file changes
+set autochdir "switch to the current file directory
+set clipboard+=unnamed "share system clipboard
+set backup "enable backups
+set backupdir=$HOME/tmp "backup directory
+set directory=$HOME/tmp "directory to place swap files in
+set viminfo+=n$HOME/tmp/.viminfo "viminfo path
+
+"Encoding settings
+if has("multi_byte")
+    if &termencoding == ""
+        let &termencoding = &encoding
+    endif
+    set encoding=utf-8
+    setglobal fileencoding=utf-8
+    set fileencodings=utf-8,default,latin1,ucs-bom
+endif
+
+"Syntax highlight
+syntax on
+set t_Co=256
+set bg=dark
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Interface Settings
+"
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+set title "show title
+set number "show line numbers
+set ruler "statusline for each window
+set visualbell t_vb= "visual beep
+
+set showcmd "show incomplete commands
+set confirm "raise a dialog asking what to do instead of failing
+
+"set mouse=a "enable mouse support
+set lazyredraw "do not redraw when running macros
+set ttyfast "fast terminal connection support
+
+set shortmess=a "abbreviations on status line
+set laststatus=2 "always statusline
+set statusline=
+set statusline+=\ %<%F\ %h%m%r%y%w
+if version >= 730
+    set statusline+=%q
+endif
+set statusline+=\ [%{GetMode()}(%n,%{mode()})]
+"set statusline+=\ %{fugitive#statusline()}
+set statusline+=%=
+set statusline+=[
+set statusline+=%{&fileformat}
+set statusline+=,%{&fenc==\"\"?&enc:&fenc}
+set statusline+=%{(exists(\"+bomb\")\ &&\ &bomb)?\",bom\":\"\"}
+set statusline+=%{(exists(\"+binary\")\ &&\ &binary)?\",bin\":\"\"}
+set statusline+=%{&endofline==1?\",eol\":\",noeol\"}
+set statusline+=]
+set statusline+=\ %{GetFileSize()}
+set statusline+=\ %k\ %-14.(%l/%L,%c%V%)\ %P\ %3p%%
+
+set wildmenu "display completion menu
+set wildmode=list:longest,list:full "content of completion menu
+"ignore some extensions while completing filename
+"set wildignore=*.o,*.so,,*.gz,*.bz2,*.tar,*.tgz,*.tbz2,*.png,*.jpg,*.jpeg,*.gif
+set wildchar=<TAB> "wildcar expansion character
+
+set modeline "allow last lines of documents set vim mode
+set modelines=3 "number of lines to check for modelines
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Keyboard Settings
+"
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+" keep ctrl-a/ctrl-e for begining/end of line
+nmap <c-a> <c-o>I
+imap <c-a> <c-o>I
+vmap <c-a> <c-o>I
+
+nmap <c-e> <c-o>A
+imap <c-e> <c-o>A
+vmap <c-e> <c-o>A
+
+"reopen current file
+map <F5> :e!<cr>
+"using redraw to disable highlighted search patterns
+nnoremap <c-L> :nohl<cr><c-L>
+
+"map F1 to open previous buffer
+nmap <F1> :bp<cr>
+imap <F1> <ESC>:bp<cr>a
+"map F2 to open next buffer
+nmap <F2> :bn<cr>
+imap <F2> <ESC>:bn<cr>a
+
+imap <c-@> <c-x><c-o>
+
+nmap <c-s-left> :tabprevious<cr>
+nmap <c-s-right> :tabnext<cr>
+nmap <c-s-up> :tabnew<cr>
+nmap <c-s-down> :tabclose<cr>
+
+nmap <c-x> :bw<cr>
+nmap <c-end> :call CleanClose()<CR>
+
+nmap <F6> :vsplit<cr>
+nmap <F7> :split<cr>
+
+"ctrl-$arrow to cycle around splitted windows
+map <c-left> <c-w>h
+map <c-right> <c-w>l
+map <c-Up> <c-w>k
+map <c-Down> <c-w>j
+
+"ident in visual mode keep selection
+vmap > >gv
+vmap < <gv
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Editor Settings
+"
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+
+set fileformats=unix,dos,mac "support all three, in this order
+set hidden "make possible to change buffer without saving
+set backspace=indent,eol,start "enhance backspacing
+set report=0 "agressive reporting
+set pastetoggle=<F11> "use <F11> to toggle between 'paste' and 'nopaste'
+set nostartofline "leave the cursor where it is
+
+"indent settings
+set autoindent
+set smartindent
+set cindent
+
+"tabs and spaces settings
+set expandtab "tab are spaces
+set tabstop=4
+set shiftwidth=4
+set shiftround "round indent to shiftwidth
+set softtabstop=4
+
+set showmatch "brace/parenthese/bracket matching
+set nowrap "wrap long lines
+if has("multi_byte")
+    set showbreak="…"
+else
+    set showbreak="+++"
+endif
+
+"show some not printable chars
+set list
+if has("multi_byte")
+    set listchars=trail:·,extends:>,precedes:<,nbsp:•,tab:▷\⋅
+else
+    set listchars=tab:>.,trail:·,extends:>,precedes:<,nbsp:%
+endif
+
+"search settings
+set hlsearch "highlight searches
+set incsearch "incremental searches
+set ignorecase "ignore case in search patterns
+set infercase "smart case support
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Code folding
+"
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+set foldmethod=indent   "fold based on indent
+set foldnestmax=10      "deepest fold is 10 levels
+set nofoldenable        "dont fold by default
+set foldlevel=1
+
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+" Filetypes Settings
+"
+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+filetype plugin indent on
+

+ 1 - 0
tools/vimpager

@@ -0,0 +1 @@
+Subproject commit 1aadf44431793923bcc28a89d875b39530e9581e

+ 3 - 0
tools/web/chroot-wrapper

@@ -0,0 +1,3 @@
+#!/bin/sh
+
+schroot -c chroot:jessie --preserve-environment -- "$(basename "${0}")" "${@}"

+ 1 - 0
tools/web/compass

@@ -0,0 +1 @@
+chroot-wrapper

+ 1 - 0
tools/web/grunt

@@ -0,0 +1 @@
+chroot-wrapper

+ 1 - 0
tools/web/sass

@@ -0,0 +1 @@
+chroot-wrapper

+ 1 - 0
zsh/.zprezto

@@ -0,0 +1 @@
+prezto

+ 1 - 0
zsh/.zpreztorc

@@ -0,0 +1 @@
+zpreztorc

+ 1 - 0
zsh/prezto

@@ -0,0 +1 @@
+Subproject commit bf9dbfd5b95c44b14a8a6af8ecf965ecea50fb29

+ 154 - 0
zsh/zpreztorc

@@ -0,0 +1,154 @@
+#
+# Sets Prezto options.
+#
+# Authors:
+#   Sorin Ionescu <sorin.ionescu@gmail.com>
+#
+
+#
+# General
+#
+
+# Set case-sensitivity for completion, history lookup, etc.
+# zstyle ':prezto:*:*' case-sensitive 'yes'
+
+# Color output (auto set to 'no' on dumb terminals).
+zstyle ':prezto:*:*' color 'yes'
+
+# Set the Zsh modules to load (man zshmodules).
+# zstyle ':prezto:load' zmodule 'attr' 'stat'
+
+# Set the Zsh functions to load (man zshcontrib).
+# zstyle ':prezto:load' zfunction 'zargs' 'zmv'
+
+# Set the Prezto modules to load (browse modules).
+# The order matters.
+zstyle ':prezto:load' pmodule \
+  'environment' \
+  'terminal' \
+  'editor' \
+  'history' \
+  'directory' \
+  'spectrum' \
+  'utility' \
+  'completion' \
+  'prompt'
+
+#
+# Editor
+#
+
+# Set the key mapping style to 'emacs' or 'vi'.
+zstyle ':prezto:module:editor' key-bindings 'emacs'
+
+# Auto convert .... to ../..
+# zstyle ':prezto:module:editor' dot-expansion 'yes'
+
+#
+# Git
+#
+
+# Ignore submodules when they are 'dirty', 'untracked', 'all', or 'none'.
+# zstyle ':prezto:module:git:status:ignore' submodules 'all'
+
+#
+# GNU Utility
+#
+
+# Set the command prefix on non-GNU systems.
+# zstyle ':prezto:module:gnu-utility' prefix 'g'
+
+#
+# History Substring Search
+#
+
+# Set the query found color.
+# zstyle ':prezto:module:history-substring-search:color' found ''
+
+# Set the query not found color.
+# zstyle ':prezto:module:history-substring-search:color' not-found ''
+
+# Set the search globbing flags.
+# zstyle ':prezto:module:history-substring-search' globbing-flags ''
+
+#
+# Pacman
+#
+
+# Set the Pacman frontend.
+# zstyle ':prezto:module:pacman' frontend 'yaourt'
+
+#
+# Prompt
+#
+
+# Set the prompt theme to load.
+# Setting it to 'random' loads a random theme.
+# Auto set to 'off' on dumb terminals.
+zstyle ':prezto:module:prompt' theme 'steeef'
+
+#
+# Ruby
+#
+
+# Auto switch the Ruby version on directory change.
+# zstyle ':prezto:module:ruby:chruby' auto-switch 'yes'
+
+#
+# Screen
+#
+
+# Auto start a session when Zsh is launched in a local terminal.
+# zstyle ':prezto:module:screen:auto-start' local 'yes'
+
+# Auto start a session when Zsh is launched in a SSH connection.
+# zstyle ':prezto:module:screen:auto-start' remote 'yes'
+
+#
+# SSH
+#
+
+# Set the SSH identities to load into the agent.
+# zstyle ':prezto:module:ssh:load' identities 'id_rsa' 'id_rsa2' 'id_github'
+
+#
+# Syntax Highlighting
+#
+
+# Set syntax highlighters.
+# By default, only the main highlighter is enabled.
+# zstyle ':prezto:module:syntax-highlighting' highlighters \
+#   'main' \
+#   'brackets' \
+#   'pattern' \
+#   'cursor' \
+#   'root'
+#
+# Set syntax highlighting styles.
+# zstyle ':prezto:module:syntax-highlighting' styles \
+#   'builtin' 'bg=blue' \
+#   'command' 'bg=blue' \
+#   'function' 'bg=blue'
+
+#
+# Terminal
+#
+
+# Auto set the tab and window titles.
+# zstyle ':prezto:module:terminal' auto-title 'yes'
+
+# Set the window title format.
+# zstyle ':prezto:module:terminal:window-title' format '%n@%m: %s'
+
+# Set the tab title format.
+# zstyle ':prezto:module:terminal:tab-title' format '%m: %s'
+
+#
+# Tmux
+#
+
+# Auto start a session when Zsh is launched in a local terminal.
+# zstyle ':prezto:module:tmux:auto-start' local 'yes'
+
+# Auto start a session when Zsh is launched in a SSH connection.
+# zstyle ':prezto:module:tmux:auto-start' remote 'yes'

+ 220 - 0
zsh/zshrc

@@ -0,0 +1,220 @@
+####################################################
+# Customized configuration for ZSH based on prezto #
+####################################################
+
+#
+# TMPDIR
+#
+export TMPDIR="${HOME}/tmp"
+if [[ ! -d "${TMPDIR}" ]]; then
+    mkdir -p "${TMPDIR}"
+fi
+
+#
+# Using zpresto
+#
+export ZDOTDIR="$(dirname "$(readlink -f "${0}")")"
+if [[ -f "${ZDOTDIR}/prezto/init.zsh" ]]; then
+    source "${ZDOTDIR}/prezto/init.zsh"
+    zstyle ':completion::complete:*' cache-path "${TMPDIR}/.zcompcache"
+    # Remove first '\n' in PS1
+    export PS1="$(echo "${PS1}" | sed ':a;N;$!ba;s/\n//')"
+fi
+
+#
+# Load some colors
+#
+
+autoload colors zsh/terminfo
+if [[ "${terminfo[colors]}" -ge 8 ]]; then
+    colors
+fi
+for color in RED GREEN YELLOW BLUE MAGENTA CYAN ORANGE WHITE; do
+    eval COLOR_$color='$terminfo[bold]$fg[${(L)color}]'
+    eval COLOR_LIGHT_$color='$fg[${(L)color}]'
+done
+COLOR_RESET="$terminfo[sgr0]"
+
+#
+# Pager
+#
+
+VIMPAGER="$(readlink -f "${ZDOTDIR}/../tools/vimpager/vimpager")"
+if (( $+commands[vim] )) && [[ -f "${VIMPAGER}" ]]; then
+    export PAGER="${VIMPAGER}"
+    alias less="${PAGER}"
+    alias more="${PAGER}"
+    export VIMPAGER_RC="$(readlink -f "${ZDOTDIR}/../tools/vim/vimpagerrc")"
+    if [[ ! -f "${VIMPAGER_RC}" ]]; then
+        unset VIMPAGER_RC
+    fi
+elif (( $+commands[less] )); then
+    export PAGER=less
+    alias more="${PAGER}"
+elif (( $+commands[more] )); then
+    export PAGER=more
+fi
+export GIT_PAGER="${PAGER}"
+unset VIMPAGER
+
+#
+# Vim
+#
+
+VIMRC="$(readlink -f "${ZDOTDIR}/../tools/vim/vimrc")"
+if [[ -f "${VIMRC}" ]]; then
+    export VIMINIT="source ${VIMRC}"
+fi
+unset VIMRC
+
+#
+# Git
+#
+
+GIT_IDENTITY_OPTS=
+if [[ -n "${LC_SSH_FULLNAME}" ]]; then
+    GIT_IDENTITY_OPTS="-c 'user.name=${LC_SSH_FULLNAME}' ${GIT_IDENTITY_OPTS}"
+fi
+if [[ -n "${LC_SSH_EMAIL}" ]]; then
+    GIT_IDENTITY_OPTS="-c 'user.email=${LC_SSH_EMAIL}' ${GIT_IDENTITY_OPTS}"
+fi
+
+GIT_FAKE_HOME="$(readlink -f "${ZDOTDIR}/../tools/git")"
+if [[ -f "${GIT_FAKE_HOME}/.gitconfig" ]]; then
+    GIT_OPTS="LC_MESSAGES=en_US.UTF-8 HOME=${GIT_FAKE_HOME}"
+    alias git="${GIT_OPTS} git ${GIT_IDENTITY_OPTS}"
+    alias g="${GIT_OPTS} git ${GIT_IDENTITY_OPTS}"
+    unset GIT_OPTS
+fi
+unset GIT_FAKE_HOME GIT_IDENTITY_OPTS
+
+#
+# Tmux
+#
+TMUX_OPTS="-2"
+TMUX_CONF="$(readlink -f "${ZDOTDIR}/../tools/tmux/tmux.conf")"
+if [[ -f "${TMUX_CONF}" ]]; then
+    TMUX_OPTS="${TMUX_OPTS} -f ${TMUX_CONF}"
+fi
+alias tmux="TMPDIR= tmux ${TMUX_OPTS}"
+unset TMUX_OPTS TMUX_CONF
+
+#
+# Common aliases / functions
+#
+
+alias ls='ls -h --color=auto'
+alias l='ls -lh --color=auto'
+
+alias rm='rm -i'
+alias mv='mv -i'
+alias cp='cp -i'
+
+export GREP_OPTIONS="--color=auto"
+alias mgrep="grep -rnisH"
+alias grep="grep"
+
+alias rsu="sudo -E zsh"
+alias reloadsh="exec zsh"
+
+alias md="mkdir -p"
+mcd() { mkdir -p "$@" && cd "$@" }
+
+alias aug='sudo apt-get update && sudo apt-get upgrade'
+
+if (( $+commands[ccze] )) ; then
+    alog='tail -n 300 -F /var/log/auth.log | ccze'
+    mlog='tail -n 300 -F /var/log/mail.log | ccze'
+    slog='tail -n 300 -F /var/log/syslog | ccze'
+else
+    alog='tail -n 300 -F /var/log/auth.log'
+    mlog='tail -n 300 -F /var/log/mail.log'
+    slog='tail -n 300 -F /var/log/syslog'
+fi
+
+scp_nosec='scp -o '\''StrictHostKeyChecking=no'\'' -o '\''UserKnownHostsFile=/dev/null'\'
+ssh_nosec='ssh -o '\''StrictHostKeyChecking=no'\'' -o '\''UserKnownHostsFile=/dev/null'\'
+
+
+#
+# History options
+#
+
+setopt extendedhistory      # add a timestamp and the duration of each command
+setopt sharehistory         # _all_ zsh sessions share the same history files
+setopt histignorealldups    # ignores duplications
+export HISTSIZE=1000000
+export SAVEHIST=1000000
+export HISTFILE="${TMPDIR}/.zhistory"
+
+
+#
+# Zsh options
+#
+
+export LISTPROMPT           # in order to scroll if completion list is too big
+
+setopt auto_cd              # a command like % /usr/local is equivalent to cd /usr/local
+setopt nohup                # don't send HUP signal when closing term session
+setopt extended_glob        # in order to use #, ~ and ^ for filename generation
+setopt always_to_end        # move to cursor to the end after completion
+setopt notify               # report the status of backgrounds jobs immediately
+setopt correct              # try to correct the spelling if possible
+setopt rmstarwait           # wait 10 seconds before querying for a rm which contains a *
+setopt noflowcontrol        # disable xon/xoff
+setopt histnostore          # don't store history command in history
+setopt nobanghist           # don't care of '!' in commands
+setopt emacs                # zle in emacs mode
+setopt pushdignoredups      # ignore dups in pushd stack
+setopt auto_continue        # send SIGCONT to jobs disowned
+setopt auto_list            # list choice on ambiguous command
+setopt auto_pushd           # cd = pushd
+setopt pushd_ignore_dups    # ignore dups in pushd
+setopt pushd_silent         # don't print stack after push/pop
+setopt bang_hist            # yeah ! expansion (use bash !$ for example)
+setopt chase_links          # cd to a symlink is in fact cd to the true dir
+setopt ksh_option_print     # modify setopt output
+setopt long_list_jobs       # list jobs in long format
+setopt no_rm_star_wait      # dont't idle 10 seconds
+
+
+#
+# Zle config
+#
+
+# autoescape specials chars with urls
+autoload -U url-quote-magic
+zle -N self-insert url-quote-magic
+
+# insert sudo at beggining of current command
+insert-sudo-prefix () {
+    local prefix
+    prefix='sudo'
+    if [ "${BUFFER:0:${#prefix}}" != "$prefix" ]; then
+        BUFFER="$prefix $BUFFER"
+        CURSOR=$(($CURSOR + $#prefix + 1))
+    fi
+}
+zle -N insert-sudo-prefix
+bindkey "^b" insert-sudo-prefix
+
+# make home and end keys work with tmux
+bindkey "^[[H" beginning-of-line
+bindkey "^[[F" end-of-line
+
+
+#
+# MOTD
+#
+
+if [[ -z "${TMUX}" ]] && [[ -z "${SUDO_UID}" ]]; then
+    if [[ -z "${LC_SSH_EMAIL}" || -z "${LC_SSH_FULLNAME}" ]]; then
+        printf "\n${COLOR_RED}You environment seems to not be properly configured: LC_SSH_EMAIL and LC_SSH_FULLNAME have to be set and forwarded through the ssh connection.${COLOR_RESET}\n"
+        exit 1
+    else
+        printf "\n${COLOR_LIGHT_GREEN}You are logged in as ${COLOR_YELLOW}${LC_SSH_FULLNAME}${COLOR_RESET} <${COLOR_YELLOW}${LC_SSH_EMAIL}${COLOR_RESET}>\n"
+    fi
+    if [[ ! -e "${SSH_AUTH_SOCK}" ]]; then
+        printf "${COLOR_LIGHT_YELLOW}Be warned that your ssh agent is not foarwarded${COLOR_RESET}\n"
+    fi
+fi