views:

121

answers:

3

I was an Eclipse user, now I have to use Vim in my machine.

I used to "compare" a file I edited with a CVS repository to do merges an commit the files, using a context menu and my mouse.

Is this possible in Vim? Opening a vimdiff for a file before commiting, and commit it from vim itself?

And how is that supposed to work?

I'm supposing I would be editing a file. Then, I want to see the modifications. I run vimdiff in gvim, and a new window (or buffer) is opened. I run the modifications, save what is applicable (using vimdiff commands), and commit running another command.

Is this all transparent in vim? Do I have to keep getting out of vim to my terminal, or can all be done inside it?

Do I need to use some plugins, or just really simple functions inside my vimrc?

+1  A: 

It depends on the VCS used, but you can linked that VCS with vimdiff (see git, for instance)

alt text


You could also try and integrate directly Vim into your Eclipse session with eclim.
(should you still be using eclipse. If not, I leave the following for others)

It does support the Eclipse local History.

alt text

VonC
+4  A: 

There is a couple plugins to integrate VCS to vim.
I personnally use vcscommand. It does at least the 2 things you're asking for: comparing from repository using vimdiff and commiting from within vim.

skinp
+1 for vcscommand - I use it all the time
Dave Kirby
vcscommand or hasen j solutions are the best options IMHO.
Somebody still uses you MS-DOS
+2  A: 

I personally just switch between vim and the terminal.

Usually I'd have several console tabs open at the same time (if you're on windows, Console can do that).

hasen j