X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=.profile.d%2Fp4.bashrc;h=b4134c084630b0ea0cecc9f65c40f33dd6f0b564;hb=d9c5170b2c04449076f00a1cff2c03d12dbe96d2;hp=7cdb1dba1847ad8c11fb207e13c32f3ae9c525b5;hpb=19a30cda6029906dbfadf0ea0e284b518947e429;p=profile.git diff --git a/.profile.d/p4.bashrc b/.profile.d/p4.bashrc index 7cdb1db..b4134c0 100644 --- a/.profile.d/p4.bashrc +++ b/.profile.d/p4.bashrc @@ -1,4 +1,3 @@ -# $Id: p4.bashrc 151 2008-11-20 13:59:19Z iain $ if [ ! -z "$SUDO_USER" ]; then export P4USER=$SUDO_USER export P4TICKETS=/tmp/.p4tickets.$SUDO_USER @@ -6,10 +5,19 @@ else export P4USER=$USER fi export P4CONFIG=.p4config -export P4DIFF="diff -u" -export P4EDITOR="vim -S '$HOME/.vim/script/p4'" +eval $(alias diff 2>/dev/null | sed 's/^alias diff/P4DIFF/') +export P4DIFF="${P4DIFF:-diff} -u" +if [ -e "$HOME/.vim/script/p4" ]; then + export P4EDITOR="vim -S '$HOME/.vim/script/p4'" +else + export P4EDITOR=vim +fi if [ -z "$DISPLAY" ]; then - export P4MERGE="vim -o -c '3wincmd j' -c 'wincmd L'" + if [ -e "$HOME/.vim/script/p4" ]; then + export P4MERGE="vim -S '$HOME/.vim/script/p4'" + else + export P4MERGE="vim -o -c '3wincmd j' -c 'wincmd L'" + fi else export P4MERGE="p4merge" fi