Simple little helper for Vim in Perforce repos
  • Shell 54.7%
  • Vim Script 45.3%
Find a file
2026-01-05 11:05:44 +01:00
plugin p4c was the wrong name for the wrapper. 2026-01-05 11:05:44 +01:00
script p4c was the wrong name for the wrapper. 2026-01-05 11:05:44 +01:00
LICENSE Initial commit 2025-08-18 15:02:23 +02:00
README.md Initial commit 2025-08-18 15:02:23 +02:00

perforce_autoopen.vim

Simple little helper for Vim in Perforce repos

Perforce keeps source files as readonly, and requires them to be checked out ("opened") before editing. Most plugins (e.g. for Visual Studio) handle this checkout transparently.

This is a little helper plugin that allows Vim to do the same: When you start editing a buffer that is readonly, the plugin calls "p4c open" on the file.

"p4c" is supposed to be a wrapper around the command line client "p4" that adjusts paths and does client settings as necessary. Unfortunately, getting that to work properly across all the possible ways you could have Vim and Perforce installed and configured on your platform proved to be too daunting, so all I can give you at this time is the "p4c" script that I use myself on WSL Ubuntu, provided in the "script" subdirectory.

This is very much quick & dirty and "works for me" only.