Check for existence of p4 script before setting $P4EDITOR.
Work around weird bug whereby calling "file [p4 diff]" when in a
directory with a subdirectory called ``d'' would confuse Vim.
Removed old debugging code which shouldn't have been still there.
-# $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
fi
export P4CONFIG=.p4config
export P4DIFF="diff -u"
-export P4EDITOR="vim -S '$HOME/.vim/script/p4'"
+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'"
else
" Delete the spec blurb if it exists.
/^# A Perforce Change Spec/,/^# *(New changelists only\.)$/d
" If the blurb was deleted the text will be in the unnamed register.
- if @" != "grgergregergeg"
+ if @" != ""
" Delete the blank line left above the remaining fields.
1
delete
let s:cmdheight = &cmdheight
set cmdheight=3
+" Change directory so "file [p4 diff]" doesn't try to cd somewhere.
+cd /
+
" Call and then discard our function.
call P4submit()
delfunction P4submit
let s:cmdheight = &cmdheight
se cmdheight=3
+" Change directory so "file [svn diff]" doesn't try to cd somewhere.
+cd /
+
" Call and then discard our function.
call SVNcommit()
delfunction SVNcommit