Home

Awesome

<div align="center" style="text-align: center"> <p><img align="center" src="res/vim-gita.256x256.png" alt="gita"></p> </div>

Travis CI AppVeyor Version 0.1.5 Support Vim 7.4 or above MIT License Doc Powered by vital.vim

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:

And lot more.

gita uses a git repository which

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.

asciicast

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

  1. HEAD (gita://<refname>:show/HEAD:<filename>)
  2. Index (gita://<refname>:show:patch/:<filename>)
  3. 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.

asciicast

Conflict

To solve conflicts, use :Gita chaperone command on a conflicted file buffer like below. It opens three buffers which indicate a content of

  1. OURS (gita://<refname>:show/:2:<filename>)
  2. WORKTREE (<filename>)
  3. THEIRS (gita://<refname>:show/:3:<filename>)

See :help gita-usage-chaperone for more detail.

asciicast

Changes

asciicast

Search (grep)

asciicast

Blame

asciicast

Bundle libraries and build statuses

gita rely on the following bundled libraries. (Note: users don't need to install them while these are bundled.)

StatusNameDescription
Build Statusvim-jp/vital.vimA core library
Build Statuslambdalisue/vital-Vim-Buffer-AnchorAn anchor buffer library
Build Statuslambdalisue/vital-ArgumentParserAn argument parser library
Build Statuslambdalisue/vital-ProgressBarA progress bar library
Build Statuslambdalisue/vital-Vim-ConsoleA console library

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.