VIM macro to perform Perforce edit on current file

p4, or perforce, is a pain. By default it keeps all files read-only, and you have to notify p4 when you want to edit a file. If you’re like me who uses tags, when I jump to a tag that is in a different file, and worse yet, different directory, it becomes annoying when I have to perform a `p4 edit` on that file. So here’s the VIM macro to accomplish this:

map ,p :!p4 edit <C-R>=expand(“%:p”) <CR>

Put this in your ~/.vimrc and you can do “,p” in your current buffer.

Technorati Tags:

Leave a Reply