Tip #366: really basic RCS interaction from within vim
tip karma |
Rating 5/4, Viewed by 405
|
created: |
|
November 8, 2002 8:31 |
|
complexity: |
|
basic |
author: |
|
Peter |
|
as of Vim: |
|
6.0 |
I've looked all around and haven't found RCS functions built into vim (which surprises me, really), so I looked more and found some almost working RCS scripts for text-mode. Key there is almost. It's still a kludge, but it works without too much hassle.
I've chosen F1 and F2, because I never use those keys for what they are intended. I use :help for command reference, not for a tutorial style thing. So, use some discretion. Also, the write command could just as easily have been a :write!, but I decided against that in the case of files that weren't checked out. You should check them out, first, and they should be writable.
map <F1> :write %<CR>:!ci -l %<CR>:edit!<CR>
map <F2> :!co -l %<CR>:edit!<CR>
New RCS files work just fine with the first mapping.
There would be some use to creating the RCS directory, if it's not already there, but I don't see an "if exists and is directory" function, right now.
There's a good menu-driven rcs client for graphical vim, but I hate menus and graphical interfaces.
<<Vim Book Online |
What is this $VIMRUNTIME ? >>
Additional Notes
|