summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2014-12-22 00:37:32 +0100
committerOlivier Gayot <duskcoder@gmail.com>2014-12-22 00:37:32 +0100
commita4c290620e32ac7737bbd545c35387b4a3a3461d (patch)
tree6d6d55587baeff59bcdf4841466a34e584746b9b
Added configuration files for zsh
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
-rw-r--r--global/etc/zshrc76
-rw-r--r--user/.zsh/aliases45
-rw-r--r--user/.zshrc19
3 files changed, 140 insertions, 0 deletions
diff --git a/global/etc/zshrc b/global/etc/zshrc
new file mode 100644
index 0000000..0ad8dd3
--- /dev/null
+++ b/global/etc/zshrc
@@ -0,0 +1,76 @@
+autoload -U colors && colors
+autoload -U compinit && compinit
+
+source /usr/share/git/completion/git-prompt.sh
+
+
+setopt NO_BG_NICE
+
+export EDITOR=vim
+bindkey -e # workaround to avoid usage of viins
+
+# history {{{
+
+HISTSIZE=50000
+HISTFILE=~/.history
+SAVEHIST=50000
+
+# }}}
+# aliases {{{
+
+alias ll='ls -l'
+alias ls='ls --color=auto'
+alias ltr='ls -tr'
+alias la='ls -a'
+alias l='ls -F'
+alias p='mplayer'
+alias h='htop'
+alias m='make'
+alias mb='make -B'
+alias v='vim'
+alias g='grep'
+alias a='alsamixer'
+alias b='exec $0'
+alias e='echo'
+alias mu='mplayer -novideo'
+alias grep='grep --color=auto'
+alias g='git'
+alias m='make'
+alias mb='make -B'
+alias vi='vim'
+alias k='kill'
+alias r='reset'
+alias pc='pacman'
+alias po='pidof'
+alias t='tig'
+
+# }}}
+# prompt {{{
+
+function __set_prompt ()
+{
+ PS1="%{$user_color%}%n%"
+ PS1+="{$fg_bold[blue]%}@"
+ PS1+="%{$fg_bold[white]%}%M"
+ PS1+="%{$reset_color%}:"
+ PS1+="%{$fg_bold[blue]%}%~"
+ PS1+="%{$reset_color%} "
+ PS1+="%{$fg_bold[green]%}$(__git_ps1 "(%s) ")"
+ PS1+="%{$reset_color%}%(!.#.$) "
+}
+
+if [ $UID -eq 0 ]; then
+ user_color=$fg_bold[red]
+else
+ user_color=$fg_bold[yellow]
+fi
+
+# this function is called each time the prompt appears.
+function precmd
+{
+ __set_prompt
+}
+
+# }}}
+
+ulimit -c unlimited
diff --git a/user/.zsh/aliases b/user/.zsh/aliases
new file mode 100644
index 0000000..0b351ef
--- /dev/null
+++ b/user/.zsh/aliases
@@ -0,0 +1,45 @@
+alias vi='vim'
+
+alias mplayer='mplayer -input file=$HOME/.mplayer/fifo'
+alias valf='valgrind --leak-check=full --show-reachable=yes'
+alias ltr='ls -tr'
+
+alias ls='ls --color=auto'
+alias ll='ls -l'
+alias l='ls -F'
+alias la='ls -a'
+alias lll='lsless -l'
+alias lsl='lsless'
+alias ltr='ls -tr'
+
+alias a='alsamixer'
+
+alias gdb='gdb -quiet'
+
+alias valf='valgrind --leak-check=full --show-reachable=yes'
+alias h='htop'
+alias mplayer='mplayer -input file=$HOME/.mplayer/fifo'
+alias mu='mplayer -novideo'
+alias p='mplayer'
+
+alias b='exec zsh'
+
+alias g='git'
+
+alias vs='vim -O'
+
+alias grep='grep --color=auto'
+
+alias norm='norm *.(c|h)'
+alias mktags='ctags **/*.(c|h|cpp|hpp|hh)'
+
+alias objd='objdump -M intel-mnemonic -d'
+
+alias m='make'
+alias mb='make -B'
+
+alias mvi='mv -i'
+
+alias rsync='rsync --progress'
+
+# vim: set ft=zsh:
diff --git a/user/.zshrc b/user/.zshrc
new file mode 100644
index 0000000..6b9a95c
--- /dev/null
+++ b/user/.zshrc
@@ -0,0 +1,19 @@
+function __source_startup_files()
+{
+ # source the global configution file
+ local file="/etc/zshrc"
+
+ if [ -r "$file" ]; then
+ source "$file"
+ fi
+
+ # source every file readable in .zsh
+ for file in $(find ".zsh" -type f -readable); do
+ source "$file"
+ done
+}
+
+__source_startup_files
+unset __source_startup_files
+
+ulimit -c unlimited