From 5e17418f1eef06e97bb621edf53530437df8b14f Mon Sep 17 00:00:00 2001 From: Urbain Vaes Date: Tue, 11 Aug 2015 15:58:37 +0200 Subject: Back up several files --- .zsh/functions | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .zsh/functions (limited to '.zsh/functions') diff --git a/.zsh/functions b/.zsh/functions new file mode 100644 index 0000000..557d1af --- /dev/null +++ b/.zsh/functions @@ -0,0 +1,25 @@ +#!/bin/zsh + +function colo { + + # Change colors for current session + $HOME/.bin/recolor.sh < ~/.Xresources/$1 + + # Load Xresources file for future sessions + xrdb ~/.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" ~/.zsh/tmp +} + +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