Ⅰ. 插件描述
[Obsolete] An awesome git handling plugin for VimⅡ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'lambdalisue/vim-gita'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'lambdalisue/vim-gita'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'lambdalisue/vim-gita'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/lambdalisue/vim-gita
Ⅳ. 文档说明
<div align="center" style="text-align: center">
<p><img align="center" src="res/vim-gita.256x256.png" alt="gita"></p></div>
The development of vim-gita has closed. Users should check lambdalisue/gina.vim which is a new impleomentation of vim-gita by using job features of Vim 8 or Neovim
gita is a git manipulation plugin which allow users to perform daily git operation within Vim's live session.
With gita, users can:
Manipulate the index of the git repository
- Stage content changes into the index
- Unstage content changes from the index
- Partially stage content changes into the index (like
git add -p) - Partially unstage content changes from the index (like
git reset -p) - Solve conflictions by using 1, 2, or 3-way diff
- Edit a commit message and commit the index into HEAD
Edit, show, diff files in
- A working tree of the git repository
- A index of the git repository
- A specified commit, branch, etc. of the git repository
List
- Files in the working tree of the git repository
- Files in the index of the git repository
- Files in a specified commit, branch, etc. of the git repository
- Files contains specified patterns
- Files changes between commits
- Blame a file content
And lot more.
gita uses a git repository which
- A current file-like buffer belongs
- A current working directory belongs
- An original file of the pseudo file-like buffer belongs
You may notice that this behavior is quite useful when you temporary open a file in a different git repository or in a non file-like buffer such as help or quickfix.
Additionally, gita aggressively uses cache mechanisms to improve its' performance. You would notice huge performance improvement if you are currently using system() to show git repository informations in statusline such as a current branch name or the number of modified files.
Install
Use your favorite Vim plugin manager such as [junegunn/vim-plug] or [Shougo/dein.vim] like:
" Plug.vim
Plug 'lambdalisue/vim-gita'
"Plug.vim (lazy)
Plug 'lambdalisue/vim-gita', {'on': ['Gita']}
" dein.vim
call dein#add('lambdalisue/vim-gita')
" dein.vim (lazy)
call dein#add('lambdalisue/vim-gita', {
\ 'on_cmd': 'Gita',
\})Or copy contents of the repository into your runtimepath manually.
Usage
First of all, all commands which gita provides start from :Gita and all commands (including :Gita itself) provide -h/-help option to show a help message of the command.
Additionally, hitting ? in manipulation windows (e.g. gita-status) shows action and mapping helps.
See :help gita-usage for more detail.
Status
To check or modify current statuses of a git repository, use :Gita status command like below.
The status of each modified files are shown a short format.
If you are not familiar with short format, see :help gita-usage-status-cheetsheet or a manpage of git-status.
Patch
To partially stage or unstage changes (like git add -p or git reset -p), use :Gita patch command on a corresponding file buffer like below.
It opens three vimdiff windows which indicates a contents of
- HEAD (
gita://<refname>:show/HEAD:<filename>) - Index (
gita://<refname>:show:patch/:<filename>) - Working tree (
<filename>)
In INDEX window, all changes saved is patched to the index of the repository.
See :help gita-usage-patch for more detail.
Conflict
To solve conflicts, use :Gita chaperone command on a conflicted file buffer like below.
It opens three buffers which indicate a content of
- OURS (
gita://<refname>:show/:2:<filename>) - WORKTREE (
<filename>) - THEIRS (
gita://<refname>:show/:3:<filename>)
See :help gita-usage-chaperone for more detail.
Changes
Search (grep)
Blame
Bundle libraries and build statuses
gita rely on the following bundled libraries. (Note: users don't need to install them while these are bundled.)
License
The MIT License (MIT)
Copyright (c) 2015 Alisue, hashnote.net
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.





