git://git.iain.cx/iain
/
profile.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Try to change to directory from which become was run.
[profile.git]
/
.profile.d
/
p4.bashrc
diff --git
a/.profile.d/p4.bashrc
b/.profile.d/p4.bashrc
index
53967d1
..
c44932a
100644
(file)
--- a/
.profile.d/p4.bashrc
+++ b/
.profile.d/p4.bashrc
@@
-1,4
+1,3
@@
-# $Id$
if [ ! -z "$SUDO_USER" ]; then
export P4USER=$SUDO_USER
export P4TICKETS=/tmp/.p4tickets.$SUDO_USER
if [ ! -z "$SUDO_USER" ]; then
export P4USER=$SUDO_USER
export P4TICKETS=/tmp/.p4tickets.$SUDO_USER
@@
-6,10
+5,20
@@
else
export P4USER=$USER
fi
export P4CONFIG=.p4config
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"
+P4EDITOR=vim
+p4script=$(find_target_profile ".vim/script/p4")
+[ -n "$p4script" ] && P4EDITOR="vim -S '$p4script'"
+export P4EDITOR
if [ -z "$DISPLAY" ]; then
if [ -z "$DISPLAY" ]; then
- export P4MERGE="vim -o -c '3wincmd j' -c 'wincmd L'"
+ p4script=$(find_target_profile ".vim/script/merge")
+ if [ -n "$p4script" ]; then
+ export P4MERGE="vim -S '$p4script'"
+ else
+ export P4MERGE="vim -o -c '3wincmd j' -c 'wincmd L'"
+ fi
else
else
- export P4MERGE="p4
v -
merge"
+ export P4MERGE="p4merge"
fi
fi
+unset p4script