Vim Perforce integration for the 21st century!
No relation to Tom Slee's or Hari Krishna Dara's plugins.
Vundle is the recommended way to install vim-perforce. Add this line to your .vimrc:
Bundle 'nfvs/vim-perforce'
Then run :PluginInstall
inside Vim.
By default, when trying to save a read-only file, a prompt to open the file for edit in Perforce is displayed.
Additionally, the following commands are available:
Display perforce information.
Start editing the current file (opened in the default changelist).
Revert the current file (a confirmation prompt is displayed).
Move the current file to a different changelist.
The following settings can be set in your .vimrc
file:
Prompt to open the file for edit in Perforce when starting to modify a read-only file.
Prompt to open the file for edit in Perforce when trying to write a read-only file (with :w!).
Restrict Perforce automatic operations (save/change read-only files) to a limited set of directories. Please note that on Windows backslashes need to be escaped. Example:
let g:perforce_auto_source_dirs = ['C:\\Users\\nfvs\\Perforce']
Send relative file paths to Perforce so it can automatically detect which root to use (useful when sharing a Perforce repository between Linux and Windows or when using Cygwin).
Use the cygpath utility to translate paths from Cygwin to absolute Windows paths. May work in cases where g:perforce_use_relative_paths does not.
Whether to prompt the user when a file is open for edit (either on change or on save).
Copyright (C) Nuno Santos. Distributed under the same terms as Vim itself. See :help license
.