Ⅰ. 插件描述
Perforce integration for VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'nfvs/vim-perforce-love-story'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'nfvs/vim-perforce-love-story'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'nfvs/vim-perforce-love-story'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/nfvs/vim-perforce
Ⅳ. 文档说明
# perforce.vim
Vim Perforce integration for the 21st century!
No relation to Tom Slee's or Hari Krishna Dara's plugins.
Installation
Vundle is the recommended way to install vim-perforce. Add this line to your .vimrc:
Bundle 'nfvs/vim-perforce'
Then run :PluginInstall
inside Vim.
Usage
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:
:P4info
Display perforce information.
:P4edit
Start editing the current file (opened in the default changelist).
:P4revert
Revert the current file (a confirmation prompt is displayed).
:P4movetocl
Move the current file to a different changelist.
Settings
The following settings can be set in your .vimrc
file:
g:perforce_open_on_change (default: 0)
Prompt to open the file for edit in Perforce when starting to modify a read-only file.
g:perforce_open_on_save (default: 1)
Prompt to open the file for edit in Perforce when trying to write a read-only file (with :w!).
g:perforce_auto_source_dirs (default: [])
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']
g:perforce_use_relative_paths (default: 0)
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).
g:perforce_use_cygpath (default: 0)
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.
g:perforce_prompt_on_open (default: 1)
Whether to prompt the user when a file is open for edit (either on change or on save).
License
Copyright (C) Nuno Santos. Distributed under the same terms as Vim itself. See :help license
.