Added p4 script for use with p4 submit.
authorIain Patterson <me@iain.cx>
Wed, 30 Jul 2008 13:30:09 +0000 (13:30 +0000)
committerIain Patterson <me@iain.cx>
Wed, 30 Jul 2008 13:30:09 +0000 (13:30 +0000)
To use, set P4EDITOR to vim -s <script>.
The script will dump syntax-highlighted diff underneath the change spec.

git-svn-id: https://svn.cambridge.iain.cx/profile/trunk@117 6be0d1a5-5cfe-0310-89b6-964be062b18b

.vim/script/p4 [new file with mode: 0644]

diff --git a/.vim/script/p4 b/.vim/script/p4
new file mode 100644 (file)
index 0000000..2195813
--- /dev/null
@@ -0,0 +1,21 @@
+:if ! &ro
+:try
+  /^# A Perforce Change Spec/,/^$/d
+
+  :set nomod
+
+  :wincmd n
+  :wincmd J
+  :r!p4 diff
+  :1
+  :delete
+
+  :setf diff
+  :set nomod
+
+  :wincmd k
+  /<enter description here>
+  :let @/ = ""
+:catch
+:endtry
+:endif