vimagit : Ease your git worflow within vim.
| script karma
Downloaded by 478
Comments, bugs, improvements
script versions (upload new version)
|From a very single vim buffer, you can perform main git operations in few key press. To name a few:
* Visualize all diffs in your git repository.
* Stage file, hunks or even just parts of a hunk using a single key press.
* Write or amend your commit message and commit in the same buffer.
* A simple asciicast: https://asciinema.org/a/28761
* A commented video presenting vimagit: https://youtu.be/_3wMmmVi6bU (thank you Mike Hartington)
This workflow is 100% inspired from magnificent emacs Magit plugin.
See complete description, and get sources from https://github.com/jreybert/vimagit
## Outstanding features
* Preview all your git changes in one unique buffer, folded at hunk level.
* Interactively stage/unstage/discard changes with one key press.
* Stage/unstage at file/hunk/line level.
* Write the commit message in the same buffer.
* From a hunk in magit buffer, jump to the file at the diff position.
* Update vim-gitgutter signs when git status is updated.
* Stable. All features are tested in continuous integration.
More to come:
* Add a push function, taking care if needed about the remote repository and branch #24 .
* Handle commit fixup! and squash!, with a smart git log popup #23 .
* Handle stash: add, pop, apply, drop #26 .
* Stage multiple hunks or file by visually selecting them #83 .
* Go through history, cherry-pick changes.
* Make vimagit more efficient for huge repositories, with a lot of diffs.
* Something is missing? Open an issue!
> Why should I use vimagit, there are already plethora git plugins for vim?
* Because you can easily stage parts of hunks, even parts of line!
* fugitive is a very complete plugin, with a lot of functions. I use it for years, and it is a fundamental tool in my workflow. But visualize your changes and staged them in broad number of files is really a pain.
* vim-gitgutter is very well integrated into vim, but without the ability to commit stages, it stays an informational plugin.
|The plugin hierarchy tree respects the vim plugin standard. It is compatible with pathogen (and most probably vundle).
git clone https://github.com/jreybert/vimagit
Click on the package to download.
ip used for rating: 188.8.131.52
||Some bugs have been reported right after the release 1.7.0
* when info section is last section, commit title like "vim: " can be intertpreted as a modeline #120
* vimagit opens in location list #119
With the new cursor behavior, commit a serie of hunk has never been so delightful! Stage one hunk and have a natural look to the next hunk in one move.
Also, think to enable vimagit support in vim-airline with `let g:airline#extensions#vimagit#enabled = 1`
* Smart cursor position when staging #96 #115
* Check user's commit message length #86 #116
* New mappings `<C-n>` `<C-p>` to jump to hunks #101
* Jump through closed files too #99
* Enlarge or shrink hunks #97
* Commit message with standard write commands :w :x :wq ZZ #91
* Add support for Vim-Signify #93
* Change inline help toggling mapping from 'h' to '?' #80
* Add magit#show_version() and g:magit_version #69
* Remove ugly 'End commit message' from vimagit buffer #84
* Add `<nowait>` to buffer mappings #85
* Fix inline help bug with commit section #110
* Handle empty commit (without staged file) and empty commit message #79
* Escape vimagit path to solve space issue #89
* Support commit.verbose=yes #98
* Escape dirs while chdir #89
* Avoid breaking tab-local directory settings #95
* Handle old vim ~ 7.4-0 fnameescape behavior on Windows #108
* Fix E871 error when staging #117
* Show custom mapping in inline help #103
Thanks to @hkupty @scps950707 @Alok @aschrab @thirtythreeforty @olshevskiy87 @poohzrn
New feature *jump* is really awesome, you must try it!
* From a hunk in the magit buffer, press *E* and *jump* the corresponding file
at the diff position. If this file is already opened in a window, cursor move
to this window.
* Add events at key points in magit buffer. User can plug commands to these
events. This new feature brings the two next features:
* If vim-gitgutter is installed, auto update its signs when git status is
* You can find in help a tip to enter in commit mode in insert mode.
* User can set its own git exec binary with g:magit_git_cmd variable.
* Commit message is preserved when the magit buffer is refreshed (fix #57)
* It is now possible to unstage by selection (fix #32)
* When opening a magit session, if a magit buffer for this git repository is
already open, jump to this buffer.
* Inline help shows mapped key instead of default (fix #72)
* Fix peculiar folding behavior when magit buffer is refreshing.
Almost a major release, with some cool new feature. But the release 1.6 will be reaaally cool!
* add command CU (commit undo) to close commit section (fix #55)
* add g:magit_discard_untracked_do_delete option (fix #66)
when set, discard an untracked file will actually delete this file
* support 'typechanged' git status type
* clear undo history after each update_buffer() call (refs #64)
undo in magit buffer did the user believe that it may undoes some vimagit
actions: it is not! magit buffer undo history is wiped at each refresh;
which means undo still works while the user is typing its commit message
* binary file detection is done with git diff (fix #60, #61)
it fixes false positive binary file detection, binary file detection on
Windows, and may eventually speed up the refresh process :)
* output an understandable message when user tries ot discard an untracked file (fix #58)
* remove unwanted --No lines in buffer-- in status line when opening magit buffer (fix #56)
* use 'diff -p' instead of 'diff --patch' (fix #52)
* better handling of some command line error code and improve some error messages
* set local foldnestmax (fix #62)
* fix next/prev jump folding
* fix modified/untracked content in submodule (fix #49)
* vimagit is now able to handle multiple git repositories (fix #44,#34,#29).
* add mappings N and P to jump to next and previous hunk (fix #25).
* reorder magit display: display modified files first.
* disable inline help by default (fix #46). It is always possible to switch
inline help display with 'h', or with g:magit_show_help
* rework magit buffer color syntax.
* display commit mode in Info section.
* rename magit buffer, now named after git repository path, e.g.
* add MagitOnly command. It can be used to craft a bash alias like:
alias magit='vim -c MagitOnly'
* safe and smart handling of quit command (fix #41,#43).
* close vimagit window if there is another window.
* switch to alternate buffer if any.
* close vim if magit buffer the only buffer.
* disable ':w' mapping, which was not safe. This feature will be re inserted
with a safer method later.
||Some bug fixes and performance improvements.
* smarter way to handle magit buffer:
- improve some internal mechanisms, which should improve performances for huge repositories
- by default, do not show untracked/deleted/added/renamed files diffs (ref #28)
see g:magit_default_show_all_files new behavior
* add g:magit_default_sections to let user choose which sections are displayed (fix #37) user can now choose which sections to display, and in which order
* magit buffer become empty after switching to other window and back (#35)
* remove warning when opening magit buffer
* check that magit buffer exists before removing it (refs #39)
* fix add binary file (fixes #27)
* fix some display problem (Unstaged changes may not be highlighted)
* fix reset and discard for binary files
* git works in a clean environment, without any configuration
||This is a major step for vimagit. It should now contain all primary command needed for staging. Then, this release should be the real 1.0 version.
* Stage parts of hunk (fixes #8 and #19)
* select some with v, then stage your selection with S
* stage a single line with L
* mark lines (can be non contiguous) with M, then stage marked lines in the hunk with S
* Stage single files in new directories (fixes #10)
* New options (fixes #18)
* g:magit_default_show_all_files to define if file diffs are shown or not at magit buffer opening.
* If magit buffer contains more than g:magit_warning_max_lines (default 10000) lines to display, user is asked if he wants to display all these lines.
* g:magit_default_fold_level to define foldlevel of magit buffer.
* These options can be overriden with new magit#show_magit() parameters (allowing user to define its own mappings/commands)
* File display is now sorted.
* Show submodule diffs (fixes #12)
* No bugs have been reported since release 1.3.
- hide file diffs: to hide/unhide diffs for a file, move the cursor to the filename and press (Enter). It allows vimagit to be fast when there is a lot of diffs in a repository.
- zo, zO, zc, zC mappings on a filename hide/unhide file diffs.
- modify hunk before staging: in the Magit buffer, it is possible to modify a hunk before staging it. Only '+' lines can be modified. No lines can be deleted or added for the moment. (fixes #9).
- handle new empty files and new symlink (fix #11).
- handle binary files (fix #13).
- stage/unstage/ignore/discard a file with cursor on the filename.
- add global mapping M to open magit buffer (it can be overwritten with g:magit_show_magit_mapping).
- remove 'C' default mapping.
- fix staging issue: sometimes, staging a hunk was failing.
- handle filenames with spaces.
- read COMMIT_EDITMSG only if exists (commit command failed for fresh new git directory)
- fix issue of some rare hunk staging (because of some whitespaces)
- stage/unstage/ignore on file header now works
- add info section (fix #6)
- add wrappers to system and systemlist, when vim doesn't support system with List (available since vim v7.4.248)
- fix git diff failing when cwd is not in top dir (it ends with an empty Magit buffer)
- ensure to not use external diff if any
- Check commentChar from git config
- default discard mapping is now DDD, to avoid mistype
- map :w<cr> to commit
- close Magit buffer with q
- put some first tests in regression, with travis