" rc file for VIM, clearcase extensions " Author: Douglas L. Potts " Created: 17-Feb-2000 " Last Edit: 26-Sep-2001 09:31 " Version: $Revision: 1.7 $ " Modifications: " 17-Feb-2000 pottsdl Created from .unixrc mappings " 09-Mar-2000 pottsdl Added Clearcase menu definition here. " Made Menus use these mappings for ease of use. " 09-Mar-2000 pottsdl Changed so checkout will allow for changes made before " checkout command was given, but still does the e! so " that no warning message come up. " Added ctver to give version. " 18-Jan-2001 pottsdl Put this file on my vim macros page. " 08-Jun-2001 pottsdl Versioned this script for upload to vim-online. " " $Id: ccase.vim,v 1.7 2001/09/07 14:01:32 dp Exp dp $ " $Log: ccase.vim,v $ " Revision 1.7 2001/09/07 14:01:32 dp " Change $Rev to $Revision " " Revision 1.6 2001/09/07 14:01:10 dp " *** empty log message *** " " Revision 1.5 2001/09/07 13:59:24 dp " Changed how Version is determined " " Revision 1.4 2001/09/07 13:56:39 dp " Removed '-nc' so that user will now be prompted for checkin and checkout " comments. Also removed common directory shortcuts since I don't use " them anyway, but left in example for other users. " " - if !exists("$view") | finish | endif if $view == "." | finish | endif if exists('g:Clearcase_loaded') | finish |endif let g:Clearcase_loaded = 1 " Setup statusline to show current view set statusline=%<%f%h%m%r%=%{$view}\ %{&ff}\ %l,%c%V\ %P let def_statusline="%<%f%h%m%r%=%{$view}\ %{&ff}\ %l,%c%V\ %P" " Abbreviate cleartool cab ct !cleartool " check-out buffer (w/ edit afterwards to get rid of RO property) cab ctco !cleartool co % :e! " check-in buffer (w/ edit afterwards to get RO property) cab ctci !cleartool ci % :e! " uncheckout buffer (w/ edit afterwards to get RO property) cab ctunco !cleartool unco % :e! " describe buffer cab ctdesc !cleartool describe % " give version of buffer cab ctver !cleartool describe -aattr version % " List my checkouts in the current view and directory cab ctcoc !cleartool lsco -cview -short -me " List my checkouts in the current view and directory, and it's sub-dir's cab ctcor !cleartool lsco -cview -short -me -recurse > $HOME/tmp/results.txt:call OpenIfNew('~/tmp/results.txt') " List all my checkouts in the current view (ALL VOBS) cab ctcov !cleartool lsco -avob -cview -short -me > $HOME/tmp/results.txt:call OpenIfNew('~/tmp/results.txt') " List current clearcase activity cab ctlsa call ListActiv() fun! s:ListActiv() exe '!cleartool lsactiv -cact' endfun " Set current activity fun! s:SetActiv() let activity = input("Enter activity code to change to:") if activity != "" exe "!cleartool setactiv ".activity endif endfun cab ctsta call SetActiv() " These commands don't work the same on UNIX vs. WinDoze if has("unix") " buffer text version tree cab cttree !cleartool lsvtree -all -merge % > $HOME/tmp/results.txt:sp ~/tmp/results.txt " buffer history cab cthist !cleartool lshistory % > $HOME/tmp/results.txt:sp ~/tmp/results.txt " xlsvtree on buffer cab ctxlsv !xlsvtree % & " xdiff with predecessor "cab ctdiff !cleartool xdiff -pred % & cab ctdiff !cleartool diff -graphical -pred % & " Give the current viewname cab ctpwv echo "Current view is: "$view else " buffer text version tree cab cttree !cleartool lsvtree -all -merge % > c:/temp/results.txt:sp c:/temp/results.txt " buffer history cab cthist !cleartool lshistory % > c:/temp/results.txt:sp c:/temp/results.txt " xlsvtree on buffer cab ctxlsv !start clearvtree.exe % " xdiff with predecessor cab ctdiff !start cleartool xdiff -pred % " Give the current viewname cab ctpwv !cleartool pwv endif " For use on a file that has filenames in it: " just put the cursor on the filename and use the map sequence. nmap ,ctci :!cleartool ci -c =input("Enter checkout comment: ") \ =expand("") nmap ,ctco :!cleartool co -c =input("Enter checkout comment: ") \ =expand("") nmap ,ctun :!cleartool unco -rm =expand("") nmap ,cthist :!cleartool lshistory =expand("") > $HOME/tmp/results.txt:call OpenIfNew('~/tmp/results.txt') if has("unix") nmap ,ctxl :!xlsvtree =expand("") & else nmap ,ctxl :!start clearvtree.exe =expand("") endif " On UNIX the vob prefix for directories is different from WinDoze. if has("unix") let vob_prfx="/vobs/" else let vob_prfx="./" endif " Shortcuts for common directories "cab vabc =vob_prfxabc_directory " Add Menus if available if (has("gui_running") && &guioptions !~# "M") || \ &wildmenu " These use the mappings defined above to accomplish the same means. " It saves on space and makes things easier to maintain. " Clearcase menu " Hint: Using makes alignment easy (Menus can have non-fixed " width fonts, so just spaces are out of the question. amenu 60.310 &Clearcase.Check&out:ctco :ctco amenu 60.320 &Clearcase.Check&in:ctci :ctci amenu 60.330 &Clearcase.&Uncheckout:ctunco :ctunco amenu 60.340 &Clearcase.-SEP1- : amenu 60.350 &Clearcase.&History:cthist :cthist amenu 60.360 &Clearcase.&Describe:ctdesc :ctdesc amenu 60.370 &Clearcase.&Version\ Tree:ctxlsv :ctxlsv amenu 60.390 &Clearcase.&List\ Current\ Activity:ctlsa :ctlsa amenu 60.400 &Clearcase.&Set\ Current\ Activity:ctsta :ctsta amenu 60.410 &Clearcase.-SEP2- : amenu 60.420 &Clearcase.Di&ff:ctdiff :ctdiff amenu 60.430 &Clearcase.&Current\ View:ctpwv :ctpwv amenu 60.440 &Clearcase.-SEP3- : amenu 60.450 &Clearcase.List\ Checkouts\ in\ this\ dir:ctcoc :ctcoc amenu 60.460 &Clearcase.List\ Checkouts\ recurse\ dir:ctcor :ctcor amenu 60.470 &Clearcase.List\ Checkouts\ in\ VOB:ctcov :ctcov endif " vim:tw=0 nowrap: