From 8df9472e0cdbab0d12211c2bc77918e8f515c409 Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Sat, 8 Aug 2015 20:08:42 +0200 Subject: Improve installation and organization --- .zsh/zsh-functions | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .zsh/zsh-functions (limited to '.zsh/zsh-functions') diff --git a/.zsh/zsh-functions b/.zsh/zsh-functions new file mode 100644 index 0000000..f9f387d --- /dev/null +++ b/.zsh/zsh-functions @@ -0,0 +1,31 @@ +function colo { + + # Change colors for current session + $HOME/.bin/recolor.sh < ~/.Xresources/Xresources.$1 + + # Load Xresources file for future sessions + xrdb ~/.Xresources/Xresources.$1 + + # Change environment variable + export COLORSCHEME=$1 + + # Change default environment variable for future sessions + sed -i --follow-symlinks "s/^export COLORSCHEME=.*$/export COLORSCHEME=$1/g" ~/dotfiles/zshrc +} + +z() { + if [[ -z "$*" ]]; then + cd "$(_z -l 2>&1 | fzf-tmux +s --tac | sed 's/^[0-9,.]* *//')" + else + _z "$@" + fi +} + +fshow() { + git log --graph --color=always \ + --format="%C(auto)%h%d %s %C(black)%C(bold)%cr" "$@" | + fzf --ansi --no-sort --reverse --tiebreak=index --toggle-sort=\` \ + --bind 'ctrl-m:execute: + echo {} | grep -o "[a-f0-9]\{7\}" | + xargs -I % sh -c "git show --color=always % | less -R"' +} -- cgit v1.2.3