Quickly and easily do a large commit from Vim

Today at work I figured out a quick way of doing a large commit from Vim. I hope that other Vimmers can use this tip!

First, use the vim :read command, using the external command for subversion status as input: :r ! svn st

Look through the list and delete the lines with files you don’t want to commit, with dd.

When only files which you plan to commit are left in the buffer, run gg <C-V> G w d to delete the status column.

Next, enter visual mode and select all the lines and join them: gg <S-V> G <S-J>

Yank this line ( yy ), then run the external command :! svn ci <C-R>" -m 'Your log msg here'. Typing Ctrl+R and ” will expand to the last register that you yanked.

That’s all! It’s not very difficult, and it made the process of doing my commits much more efficient. Let me know in the comments if it helped you.

Comments

  1. Rob says:

    Genius. I can’t believe I didn’t think of this.

    Now it just needs to be pluginified.

Submit a Comment