Vim logo vim online Vim Book Ad

basic 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.

 rate this tip  Life Changing Helpful Unfulfilling 

<<Vim Book Online | What is this $VIMRUNTIME ? >>

Additional Notes

[email protected], November 8, 2002 9:53
If you are referring to rcs-menu.vim, even though it has a menu/graphical interface,
it also creates mappings to do the same operations, which to me is more useful.  So
I guess you really get the best of both worlds that way.
feral of the firetop, November 9, 2002 1:15
> but I don't see an "if exists and is directory" function, right now.
How about  isdirectory() ?

if isdirectory("c:/vim/vimfiles/")
    "dir exists
endif

Luck!
If you have questions or remarks about this site, visit the vimonline development pages. Please use this site responsibly.
Questions about Vim should go to [email protected] after searching the archive. Help Bram help Uganda.
SourceForge Logo