diff --git a/index.html b/index.html index 5349b29b18cd2636885cc3ac595ffc19dbe09153..eca8bc62d06a61e34b71166dba9298d961f978b3 100644 --- a/index.html +++ b/index.html @@ -51,8 +51,15 @@ <li>Write or amend your commit message and commit.</li> </ul> -<p>See a usage example: -<a href="https://asciinema.org/a/28761"><img src="https://asciinema.org/a/28761.png" alt="asciicast"></a></p> +<p><img src="../gh-pages/images/vimagit_screenshot_1.5.1.png?raw=true" alt="Example of vimagit 1.5.1" title="Example of vimagit 1.5.1"></p> + +<p>Some screencasts:</p> + +<ul> +<li>A simple <a href="https://asciinema.org/a/28761">asciicast</a> +</li> +<li>A <a href="https://youtu.be/_3wMmmVi6bU">commented video presenting vimagit</a> (thank you <a href="https://github.com/mhartington">Mike Hartington</a>!)</li> +</ul> <p>This workflow is 100% inspired from magnificent emacs <a href="https://github.com/magit/magit">Magit</a> plugin.</p> @@ -67,7 +74,8 @@ <li>[x] Stage part of hunks, by visual select, lines or selecting bunch of lines with marks.</li> <li>[x] Start to write the commit message in one key press, commit also in one key press.</li> <li>[x] Modify in line the content just before staging it.</li> -<li>[x] Visualize stashes. Apply, pop, drop are on going.</li> +<li>[x] Move easily through hunks.</li> +<li>[x] Handle multiple git repositories within one vim instance.</li> <li>[x] Add file to .gitignore file.</li> <li>[ ] Chase all corner cases. Please remember that vimagit is at an early development stage. If you try vimagit and nothing is working, please don't throw it, fill an <a href="https://github.com/jreybert/vimagit/issues/new">issue</a> on github <img class="emoji" title=":heart:" alt=":heart:" src="https://assets-cdn.github.com/images/icons/emoji/unicode/2764.png" height="20" width="20" align="absmiddle"> !</li> </ul> @@ -81,6 +89,7 @@ <li>Handle multiple git repositories within one vim session.</li> <li>Stage multiple hunks or file by visually selecting them.</li> <li>Go through history, cherry-pick changes.</li> +<li>Handle stash: add, pop, apply, drop...</li> <li>Vizualize and checkout branches.</li> <li>Something is missing? Open an <a href="https://github.com/jreybert/vimagit/issues/new">issue</a>!</li> </ul> @@ -119,30 +128,26 @@ <p>This is the minimal required set of command you must know to start playing with vimagit. See <a href="#mapping">Mapping</a> for a complete description.</p> -<h4> -<a id="magit" class="anchor" href="#magit" aria-hidden="true"><span class="octicon octicon-link"></span></a>:Magit</h4> - -<p>Open magit buffer.</p> +<p>To simply test vimagit, modify/add/delete/rename some files in a git repository and open vim.</p> <h4> -<a id="entercr" class="anchor" href="#entercr" aria-hidden="true"><span class="octicon octicon-link"></span></a>Enter,<CR></h4> +<a id="magit" class="anchor" href="#magit" aria-hidden="true"><span class="octicon octicon-link"></span></a>:Magit</h4> -<p>All files diffs are hidden by default. To inspect changes in a file, move cursor to the filename line, and press 'Enter' in Normal mode. Diffs are displayed below the file name.</p> +<p>Open magit buffer with <a href="#magitshow_magit">:Magit</a> command.</p> <h4> -<a id="s" class="anchor" href="#s" aria-hidden="true"><span class="octicon octicon-link"></span></a>S</h4> +<a id="n" class="anchor" href="#n" aria-hidden="true"><span class="octicon octicon-link"></span></a>N</h4> <ul> -<li>Modify a file, for example foo.c, in your repository.</li> -<li>Move the cursor the line 'modfied: foo.c' in "Unstage changes" section, press <strong>S</strong> in Normal mode: the file is stage, and appears in "Stage changes" section.</li> -<li>Move to the line 'modified: foo.c' in "Stage changes" section, press <strong>S</strong> in Normal mode: the file is unstage, and appears in "Unstaged changes" section.</li> +<li>Jump to next hunk with <strong>N</strong>. The cursor should be on the header of a hunk.</li> </ul> -<p>More about <strong>S</strong>:</p> +<h4> +<a id="s" class="anchor" href="#s" aria-hidden="true"><span class="octicon octicon-link"></span></a>S</h4> <ul> -<li>It works exactely the same for new/renamed/deleted files.</li> -<li>Stage/unstage by hunk is easy: display file diffs with <a href="#entercr">Enter</a>. If diffs are composed of multiple hnuks, move the cursor to a hunk, and press <strong>S</strong> to stage/unstage this hunk.</li> +<li>If the hunk is in "Unstage changes" section, press <strong>S</strong> in Normal mode: the hunk is now staged, and appears in "Staged changes" section. The opposite is also possible, i.e. unstage a hunk from "Staged section".</li> +<li>If you move the cursor to the file header and press <strong>S</strong>, the whole file is staged.</li> </ul> <h4> @@ -206,8 +211,10 @@ <h4> <a id="magitshow_magit" class="anchor" href="#magitshow_magit" aria-hidden="true"><span class="octicon octicon-link"></span></a>magit#show_magit()</h4> -<p>Function to open magit buffer. -It takes 3 parameters:</p> +<p>Function to open magit buffer. This buffer will handle the git repository including focused file. +It is possible to handle multiple git repositories within one vim instance.</p> + +<p>It takes 3 parameters:</p> <ul> <li>orientation (mandatory): it can be @@ -229,9 +236,14 @@ new buffer</li> <h4> <a id="magit-1" class="anchor" href="#magit-1" aria-hidden="true"><span class="octicon octicon-link"></span></a>:Magit</h4> -<ul> -<li>open magit buffer.</li> -</ul> +<p>Open magit buffer in a vertical split (see <a href="magitshow_magit">details</a>).</p> + +<h4> +<a id="magitonly" class="anchor" href="#magitonly" aria-hidden="true"><span class="octicon octicon-link"></span></a>:MagitOnly</h4> + +<p>Open magit buffer in current window (see <a href="magitshow_magit">details</a>).</p> + +<p>You can create a bash alias like magit="vim -c MagitOnly"</p> <h3> <a id="mappings" class="anchor" href="#mappings" aria-hidden="true"><span class="octicon octicon-link"></span></a>Mappings</h3> @@ -254,7 +266,7 @@ new buffer</li> <p>Following mappings are set locally, for magit buffer only, in normal mode.</p> <h5> -<a id="entercr-1" class="anchor" href="#entercr-1" aria-hidden="true"><span class="octicon octicon-link"></span></a>Enter,<CR></h5> +<a id="entercr" class="anchor" href="#entercr" aria-hidden="true"><span class="octicon octicon-link"></span></a>Enter,<CR></h5> <ul> <li>All files are folded by default. To see the changes in a file, move cursor to the filename line, and press Enter. You can close the changes display retyping Enter.</li> @@ -320,6 +332,13 @@ new buffer</li> <li>Only works in "Unstaged changes" section.</li> </ul> +<h5> +<a id="np" class="anchor" href="#np" aria-hidden="true"><span class="octicon octicon-link"></span></a>N,P</h5> + +<ul> +<li>Move to <strong>N</strong>ext or <strong>P</strong>revious hunk.</li> +</ul> + <h5> <a id="cc-1" class="anchor" href="#cc-1" aria-hidden="true"><span class="octicon octicon-link"></span></a>CC</h5> @@ -465,6 +484,15 @@ git clone https://github.com/jreybert/vimagit <p>At least, it is tested with vim 7.3.249 and git 1.8.5.6 (see <a href="#integration">Integration</a>).</p> +<h2> +<a id="credits" class="anchor" href="#credits" aria-hidden="true"><span class="octicon octicon-link"></span></a>Credits</h2> + +<ul> +<li>Obviously, big credit to <a href="https://github.com/magit/magit">magit</a>. For the moment, I am only copying their stage workflow, but I won't stop there! They have a lot of other good ideas.</li> +<li>Sign handling is based on <a href="https://github.com/airblade/vim-gitgutter">gitgutter</a> work.</li> +<li>Command line completion is based on <a href="https://github.com/c9s/hypergit.vim">hypergit</a> work.</li> +</ul> + <h2> <a id="license" class="anchor" href="#license" aria-hidden="true"><span class="octicon octicon-link"></span></a>License</h2> diff --git a/params.json b/params.json index 8abb94ebad822ce0af000f36ca883ba7b08255fb..2ef492a920ccb77ac16f3df720c5452207de1840 100644 --- a/params.json +++ b/params.json @@ -1 +1 @@ -{"name":"Vimagit","tagline":"A new way to use git within vim","body":"# vimagit\r\n\r\nThis is a new (and hopefully very efficient) way to use git from vim.\r\n\r\nFrom a very single vim buffer, you can perform all basic git operations. To name a few:\r\n* Visualize all diffs in your git repository.\r\n* Stage files/hunks/parts of hunks with single key S.\r\n* Write or amend your commit message and commit.\r\n\r\nSee a usage example:\r\n[](https://asciinema.org/a/28761)\r\n\r\nThis workflow is 100% inspired from magnificent emacs [Magit](https://github.com/magit/magit) plugin.\r\n\r\nTake a look at [TL;DR](#tldr) to start using it immediatly.\r\n\r\n## Outstanding features\r\n\r\n* [x] See all your changes, staged changes, untracked/removed/renamed files in one unique buffer.\r\n* [x] Staged/unstaged/discard changes with one key press, moving the cursor around. Stage at hunk or file level. Line and partial line staging are ongoing.\r\n* [x] Stage part of hunks, by visual select, lines or selecting bunch of lines with marks.\r\n* [x] Start to write the commit message in one key press, commit also in one key press.\r\n* [x] Modify in line the content just before staging it.\r\n* [x] Visualize stashes. Apply, pop, drop are on going.\r\n* [x] Add file to .gitignore file.\r\n* [ ] Chase all corner cases. Please remember that vimagit is at an early development stage. If you try vimagit and nothing is working, please don't throw it, fill an [issue](https://github.com/jreybert/vimagit/issues/new) on github :heart: !\r\n\r\nMore to come:\r\n* Make vimagit more efficient for huge repositories, with a lot of diffs.\r\n* Add a push function, taking care if needed about the remote repository and branch.\r\n* Handle commit fixup! and squash!, with a smart git log popup.\r\n* Handle multiple git repositories within one vim session.\r\n* Stage multiple hunks or file by visually selecting them.\r\n* Go through history, cherry-pick changes.\r\n* Vizualize and checkout branches.\r\n* Something is missing? Open an [issue](https://github.com/jreybert/vimagit/issues/new)!\r\n\r\n> Why should I use vimagit, there are already plethora git plugins for vim?\r\n\r\n* 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.\r\n* vim-gitgutter is very well integrated into vim, but without the ability to commit stages, it stays an informational plugin.\r\n\r\n## Integration\r\n\r\nBranches [master](https://github.com/jreybert/vimagit/) and [next](https://github.com/jreybert/vimagit/tree/next) are continuously tested on [travis](https://travis-ci.org/jreybert/vimagit) when published on github.\r\n\r\nvimagit is tested with various versions of vim on linux: vim 7.3.249, vim 7.4.273, and latest neovim version. It is also tested for macos X: vim, macvim and neovim. Anyway, if you feel that vimagit behaves oddly (slow refresh, weird display order...) please fill an [issue](https://github.com/jreybert/vimagit/issues/new).\r\n\r\nFor the most enthusiastic, you can try the branch [next](https://github.com/jreybert/vimagit/tree/next). It is quite stable, just check its travis status before fetching it.\r\n\r\nTravis status:\r\n* **[master status](https://travis-ci.org/jreybert/vimagit/branches)**: [](https://travis-ci.org/jreybert/vimagit/branches)\r\n* **[next status](https://travis-ci.org/jreybert/vimagit/branches)**: [](https://travis-ci.org/jreybert/vimagit/branches)\r\n\r\n## TL;DR\r\n\r\nThis is the minimal required set of command you must know to start playing with vimagit. See [Mapping](#mapping) for a complete description.\r\n\r\n#### :Magit\r\n\r\nOpen magit buffer.\r\n\r\n#### Enter,\\<CR\\>\r\n\r\nAll files diffs are hidden by default. To inspect changes in a file, move cursor to the filename line, and press 'Enter' in Normal mode. Diffs are displayed below the file name.\r\n\r\n#### S\r\n\r\n* Modify a file, for example foo.c, in your repository.\r\n* Move the cursor the line 'modfied: foo.c' in \"Unstage changes\" section, press **S** in Normal mode: the file is stage, and appears in \"Stage changes\" section.\r\n* Move to the line 'modified: foo.c' in \"Stage changes\" section, press **S** in Normal mode: the file is unstage, and appears in \"Unstaged changes\" section.\r\n\r\nMore about **S**:\r\n\r\n* It works exactely the same for new/renamed/deleted files.\r\n* Stage/unstage by hunk is easy: display file diffs with [Enter](#entercr). If diffs are composed of multiple hnuks, move the cursor to a hunk, and press **S** to stage/unstage this hunk.\r\n\r\n#### CC\r\n\r\nOnce you have stage all the required changes, press **CC**. A new section \"Commit message\" appears and cursor move to it. Type your commit message, in Insert mode this time. Once it's done, go back in Normal mode, and press **CC**: you created your first commit with vimagit!\r\n\r\n## Usage\r\n\r\n### Sections\r\n\r\nIMPORTANT: mappings can have different meanings regarding the cursor position.\r\n\r\nThere are 5 sections:\r\n* Info: this section display some information about the git repository, like the current branch and the HEAD commit.\r\n* Commit message: this section appears in commit mode (see below). It contains the message to be commited.\r\n* Staged changes: this sections contains all staged files/hunks, ready to commit.\r\n* Unstaged changes: this section contains all unstaged and untracked files/hunks.\r\n* Stash list: this section contains all stahes.\r\n\r\n### Inline modifications\r\n* It is possible to modify the content to be staged or unstaged in magit buffer, with some limitations:\r\n * only lines starting with a + sign can be modified\r\n * no line can be deleted\r\n\r\n### Visual selection\r\n\r\nIt is possible to stage part of hunk, by different ways:\r\n* By visually selecting some lines, then staging the selection with **S**.\r\n* By marking some lines \"to be staged\" with **M**, then staging these selected lines with **S**.\r\n* Staging individual lines with **L**.\r\n\r\nVisual selection and marked lines have some limitations for the moment:\r\n* It only work for \"staging\", not for \"unstaging\".\r\n* Selection/marks must be within a single hunk.\r\n* Marks not within the hunk currently staged are lost during stage process magit buffer refresh.\r\n\r\n### Commands\r\n\r\n#### magit#show_magit()\r\n\r\nFunction to open magit buffer.\r\nIt takes 3 parameters:\r\n * orientation (mandatory): it can be\r\n - 'v', curent window is split vertically, and magit is displayed in new\r\n buffer\r\n - 'h', curent window is split horizontally, and magit is displayed in\r\n new buffer\r\n - 'c', magit is displayed in current buffer\r\n * show_all_files: define how file diffs are shown by default for this session\r\n (see [g:magit_default_show_all_files](#gmagit_default_show_all_files))\r\n * foldlevel: set default magit buffer foldlevel for this session\r\n (see [g:magit_default_fold_level](#gmagit_default_fold_level))\r\n\r\n#### :Magit\r\n * open magit buffer.\r\n\r\n### Mappings\r\n\r\nFor each mapping, user can redefine the behavior with its own mapping. Each variable is described in vimagit help like *vimagit-g:magit_nameofmapping_mapping*\r\n\r\n#### Global mappings\r\n\r\nFollowing mappings are broadly set, and are applied in all vim buffers.\r\n\r\n##### \\<Leader>M\r\nOpen Magit buffer\r\n\r\n#### Local mappings\r\n\r\nFollowing mappings are set locally, for magit buffer only, in normal mode.\r\n\r\n##### Enter,\\<CR\\>\r\n * All files are folded by default. To see the changes in a file, move cursor to the filename line, and press Enter. You can close the changes display retyping Enter.\r\n\r\n##### zo,zO\r\n * Typing zo on a file will unhide its diffs.\r\n\r\n##### zc,zC\r\n * Typing zc on a file will hide its diffs.\r\n\r\n##### S\r\n * If cursor is in a hunk, stage/unstage hunk at cursor position.\r\n * If cursor is in diff header, stage/unstage whole file at cursor position.\r\n * If some lines in the hunk are selected (using **v**), stage only visual selected lines (only works for staging).\r\n * If some lines in the hunk are marked (using **M**), stage only marked lines (only works for staging).\r\n * When cursor is in \"Unstaged changes\" section, it will stage the hunk/file.\r\n * On the other side, when cursor is in \"Staged changes\" section, it will unstage hunk/file.\r\n\r\n##### F\r\n * Stage/unstage the whole file at cursor position.\r\n * When cursor is in \"Unstaged changes\" section, it will stage the file.\r\n * On the other side, when cursor is in \"Staged changes\" section, it will unstage file.\r\n\r\n##### L\r\n * Stage the line under the cursor.\r\n\r\n##### M\r\n * Mark the line under the cursor \"to be staged\".\r\n * If some lines in the hunk are selected (using **v**), mark selected lines \"to be staged\".\r\n * To staged marked lines in a hunk, move cursor to this hunk and press **S**.\r\n\r\n##### DDD\r\n * If cursor is in a hunk, discard hunk at cursor position.\r\n * If cursor is in diff header, discard whole file at cursor position.\r\n * Only works in \"Unstaged changes\" section.\r\n\r\n##### CC\r\n * If not in commit section, set commit mode to \"New commit\" and show \"Commit message\" section with brand new commit message.\r\n * If in commit section, commit the all staged changes in commit mode previously set.\r\n\r\n##### CA\r\n * If not in commit section, set commit mode to \"Amend commit\" and show \"Commit message\" section with previous commit message.\r\n * If in commit section, commit the staged changes in commit mode previously set.\r\n\r\n##### CF\r\n * Amend the staged changes into the previous commit, without modifying previous commit message.\r\n\r\n##### I\r\n * Add the file under the cursor in .gitgnore\r\n\r\n##### R\r\n * Refresh magit buffer\r\n\r\n##### q\r\n * Close the magit buffer\r\n\r\n##### h\r\n * Toggle help showing in magit buffer\r\n\r\n### Options\r\n\r\nUser can define in its prefered |vimrc| some options.\r\n\r\n#### g:magit_enabled\r\n\r\nTo enable or disable vimagit plugin.\r\nDefault value is 1.\r\n> let g:magit_enabled=[01]\r\n\r\n#### g:magit_show_help\r\n\r\nTo disable chatty inline help in magit buffer (default 1)\r\n> let g:magit_show_help=[01]\r\n\r\n#### g:magit_default_show_all_files\r\n\r\nWhen this variable is set to 0, all diff files are hidden by default.\r\nWhen this variable is set to 1, all diff for modified files are shown by default.\r\nWhen this variable is set to 2, all diff for all files are shown by default.\r\nDefault value is 1.\r\nNB: for repository with large number of differences, display may be slow.\r\n> let g:magit_default_show_all_files=[012]\r\n\r\n#### g:magit_default_fold_level\r\n\r\nDefault foldlevel for magit buffer.\r\nWhen set to 0, both filenames and hunks are folded.\r\nWhen set to 1, filenames are unfolded and hunks are folded.\r\nWhen set to 2, filenames and hunks are unfolded.\r\nDefault value is 1.\r\n> let g:magit_default_fold_level=[012]\r\n\r\n#### g:magit_default_sections\r\n\r\nWith this variable, the user is able to choose which sections are displayed in magit\r\nbuffer, and in which order.\r\nDefault value:\r\n> let g:magit_default_sections = ['info', 'global_help', 'commit', 'staged', 'unstaged']\r\n\r\n#### g:magit_warning_max_lines\r\n\r\nThis variable is the maximum number of diff lines that vimagit will display\r\nwithout warning the user. If the number of diff lines to display is greater than\r\nthis variable, vimagit will ask a confirmation to the user before refreshing the\r\nbuffer. If user answer is 'yes', vimagit will display diff lines as expected.\r\nIf user answer is 'no', vimagit will close all file diffs before refreshing.\r\nDefault value is 10000.\r\n> let g:magit_warning_max_lines=val\r\n\r\n## Installation\r\n\r\nThe plugin hierarchy tree respects the vim plugin standard. It is compatible\r\nwith pathogen (and most probably vundle).\r\n\r\nTo install:\r\n\r\n cd ~/.vim/bundle\r\n git clone https://github.com/jreybert/vimagit\r\n\r\n## Requirements\r\n\r\nThis part must be refined, I don't see any minimal version for git and vim, but for sure there should be one.\r\n\r\nAt least, it is tested with vim 7.3.249 and git 1.8.5.6 (see [Integration](#integration)).\r\n\r\n## License\r\n\r\nCopyright (c) Jerome Reybert. Distributed under the same terms as Vim itself. See :help license.\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."} \ No newline at end of file +{"name":"Vimagit","tagline":"A new way to use git within vim","body":"# vimagit\r\n\r\nThis is a new (and hopefully very efficient) way to use git from vim.\r\n\r\nFrom a very single vim buffer, you can perform all basic git operations. To name a few:\r\n* Visualize all diffs in your git repository.\r\n* Stage files/hunks/parts of hunks with single key S.\r\n* Write or amend your commit message and commit.\r\n\r\n\r\n\r\nSome screencasts:\r\n* A simple [asciicast](https://asciinema.org/a/28761)\r\n* A [commented video presenting vimagit](https://youtu.be/_3wMmmVi6bU) (thank you [Mike Hartington](https://github.com/mhartington)!)\r\n\r\nThis workflow is 100% inspired from magnificent emacs [Magit](https://github.com/magit/magit) plugin.\r\n\r\nTake a look at [TL;DR](#tldr) to start using it immediatly.\r\n\r\n## Outstanding features\r\n\r\n* [x] See all your changes, staged changes, untracked/removed/renamed files in one unique buffer.\r\n* [x] Staged/unstaged/discard changes with one key press, moving the cursor around. Stage at hunk or file level. Line and partial line staging are ongoing.\r\n* [x] Stage part of hunks, by visual select, lines or selecting bunch of lines with marks.\r\n* [x] Start to write the commit message in one key press, commit also in one key press.\r\n* [x] Modify in line the content just before staging it.\r\n* [x] Move easily through hunks.\r\n* [x] Handle multiple git repositories within one vim instance.\r\n* [x] Add file to .gitignore file.\r\n* [ ] Chase all corner cases. Please remember that vimagit is at an early development stage. If you try vimagit and nothing is working, please don't throw it, fill an [issue](https://github.com/jreybert/vimagit/issues/new) on github :heart: !\r\n\r\nMore to come:\r\n* Make vimagit more efficient for huge repositories, with a lot of diffs.\r\n* Add a push function, taking care if needed about the remote repository and branch.\r\n* Handle commit fixup! and squash!, with a smart git log popup.\r\n* Handle multiple git repositories within one vim session.\r\n* Stage multiple hunks or file by visually selecting them.\r\n* Go through history, cherry-pick changes.\r\n* Handle stash: add, pop, apply, drop...\r\n* Vizualize and checkout branches.\r\n* Something is missing? Open an [issue](https://github.com/jreybert/vimagit/issues/new)!\r\n\r\n> Why should I use vimagit, there are already plethora git plugins for vim?\r\n\r\n* 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.\r\n* vim-gitgutter is very well integrated into vim, but without the ability to commit stages, it stays an informational plugin.\r\n\r\n## Integration\r\n\r\nBranches [master](https://github.com/jreybert/vimagit/) and [next](https://github.com/jreybert/vimagit/tree/next) are continuously tested on [travis](https://travis-ci.org/jreybert/vimagit) when published on github.\r\n\r\nvimagit is tested with various versions of vim on linux: vim 7.3.249, vim 7.4.273, and latest neovim version. It is also tested for macos X: vim, macvim and neovim. Anyway, if you feel that vimagit behaves oddly (slow refresh, weird display order...) please fill an [issue](https://github.com/jreybert/vimagit/issues/new).\r\n\r\nFor the most enthusiastic, you can try the branch [next](https://github.com/jreybert/vimagit/tree/next). It is quite stable, just check its travis status before fetching it.\r\n\r\nTravis status:\r\n* **[master status](https://travis-ci.org/jreybert/vimagit/branches)**: [](https://travis-ci.org/jreybert/vimagit/branches)\r\n* **[next status](https://travis-ci.org/jreybert/vimagit/branches)**: [](https://travis-ci.org/jreybert/vimagit/branches)\r\n\r\n## TL;DR\r\n\r\nThis is the minimal required set of command you must know to start playing with vimagit. See [Mapping](#mapping) for a complete description.\r\n\r\nTo simply test vimagit, modify/add/delete/rename some files in a git repository and open vim.\r\n\r\n#### :Magit\r\n\r\nOpen magit buffer with [:Magit](#magitshow_magit) command.\r\n\r\n#### N\r\n\r\n* Jump to next hunk with **N**. The cursor should be on the header of a hunk.\r\n\r\n#### S\r\n\r\n* If the hunk is in \"Unstage changes\" section, press **S** in Normal mode: the hunk is now staged, and appears in \"Staged changes\" section. The opposite is also possible, i.e. unstage a hunk from \"Staged section\".\r\n* If you move the cursor to the file header and press **S**, the whole file is staged.\r\n\r\n#### CC\r\n\r\nOnce you have stage all the required changes, press **CC**. A new section \"Commit message\" appears and cursor move to it. Type your commit message, in Insert mode this time. Once it's done, go back in Normal mode, and press **CC**: you created your first commit with vimagit!\r\n\r\n## Usage\r\n\r\n### Sections\r\n\r\nIMPORTANT: mappings can have different meanings regarding the cursor position.\r\n\r\nThere are 5 sections:\r\n* Info: this section display some information about the git repository, like the current branch and the HEAD commit.\r\n* Commit message: this section appears in commit mode (see below). It contains the message to be commited.\r\n* Staged changes: this sections contains all staged files/hunks, ready to commit.\r\n* Unstaged changes: this section contains all unstaged and untracked files/hunks.\r\n* Stash list: this section contains all stahes.\r\n\r\n### Inline modifications\r\n* It is possible to modify the content to be staged or unstaged in magit buffer, with some limitations:\r\n * only lines starting with a + sign can be modified\r\n * no line can be deleted\r\n\r\n### Visual selection\r\n\r\nIt is possible to stage part of hunk, by different ways:\r\n* By visually selecting some lines, then staging the selection with **S**.\r\n* By marking some lines \"to be staged\" with **M**, then staging these selected lines with **S**.\r\n* Staging individual lines with **L**.\r\n\r\nVisual selection and marked lines have some limitations for the moment:\r\n* It only work for \"staging\", not for \"unstaging\".\r\n* Selection/marks must be within a single hunk.\r\n* Marks not within the hunk currently staged are lost during stage process magit buffer refresh.\r\n\r\n### Commands\r\n\r\n#### magit#show_magit()\r\n\r\nFunction to open magit buffer. This buffer will handle the git repository including focused file.\r\nIt is possible to handle multiple git repositories within one vim instance.\r\n\r\nIt takes 3 parameters:\r\n * orientation (mandatory): it can be\r\n - 'v', curent window is split vertically, and magit is displayed in new\r\n buffer\r\n - 'h', curent window is split horizontally, and magit is displayed in\r\n new buffer\r\n - 'c', magit is displayed in current buffer\r\n * show_all_files: define how file diffs are shown by default for this session\r\n (see [g:magit_default_show_all_files](#gmagit_default_show_all_files))\r\n * foldlevel: set default magit buffer foldlevel for this session\r\n (see [g:magit_default_fold_level](#gmagit_default_fold_level))\r\n\r\n#### :Magit\r\nOpen magit buffer in a vertical split (see [details](magitshow_magit)).\r\n\r\n#### :MagitOnly\r\nOpen magit buffer in current window (see [details](magitshow_magit)).\r\n\r\nYou can create a bash alias like magit=\"vim -c MagitOnly\"\r\n\r\n### Mappings\r\n\r\nFor each mapping, user can redefine the behavior with its own mapping. Each variable is described in vimagit help like *vimagit-g:magit_nameofmapping_mapping*\r\n\r\n#### Global mappings\r\n\r\nFollowing mappings are broadly set, and are applied in all vim buffers.\r\n\r\n##### \\<Leader>M\r\nOpen Magit buffer\r\n\r\n#### Local mappings\r\n\r\nFollowing mappings are set locally, for magit buffer only, in normal mode.\r\n\r\n##### Enter,\\<CR\\>\r\n * All files are folded by default. To see the changes in a file, move cursor to the filename line, and press Enter. You can close the changes display retyping Enter.\r\n\r\n##### zo,zO\r\n * Typing zo on a file will unhide its diffs.\r\n\r\n##### zc,zC\r\n * Typing zc on a file will hide its diffs.\r\n\r\n##### S\r\n * If cursor is in a hunk, stage/unstage hunk at cursor position.\r\n * If cursor is in diff header, stage/unstage whole file at cursor position.\r\n * If some lines in the hunk are selected (using **v**), stage only visual selected lines (only works for staging).\r\n * If some lines in the hunk are marked (using **M**), stage only marked lines (only works for staging).\r\n * When cursor is in \"Unstaged changes\" section, it will stage the hunk/file.\r\n * On the other side, when cursor is in \"Staged changes\" section, it will unstage hunk/file.\r\n\r\n##### F\r\n * Stage/unstage the whole file at cursor position.\r\n * When cursor is in \"Unstaged changes\" section, it will stage the file.\r\n * On the other side, when cursor is in \"Staged changes\" section, it will unstage file.\r\n\r\n##### L\r\n * Stage the line under the cursor.\r\n\r\n##### M\r\n * Mark the line under the cursor \"to be staged\".\r\n * If some lines in the hunk are selected (using **v**), mark selected lines \"to be staged\".\r\n * To staged marked lines in a hunk, move cursor to this hunk and press **S**.\r\n\r\n##### DDD\r\n * If cursor is in a hunk, discard hunk at cursor position.\r\n * If cursor is in diff header, discard whole file at cursor position.\r\n * Only works in \"Unstaged changes\" section.\r\n\r\n##### N,P\r\n * Move to **N**ext or **P**revious hunk.\r\n\r\n##### CC\r\n * If not in commit section, set commit mode to \"New commit\" and show \"Commit message\" section with brand new commit message.\r\n * If in commit section, commit the all staged changes in commit mode previously set.\r\n\r\n##### CA\r\n * If not in commit section, set commit mode to \"Amend commit\" and show \"Commit message\" section with previous commit message.\r\n * If in commit section, commit the staged changes in commit mode previously set.\r\n\r\n##### CF\r\n * Amend the staged changes into the previous commit, without modifying previous commit message.\r\n\r\n##### I\r\n * Add the file under the cursor in .gitgnore\r\n\r\n##### R\r\n * Refresh magit buffer\r\n\r\n##### q\r\n * Close the magit buffer\r\n\r\n##### h\r\n * Toggle help showing in magit buffer\r\n\r\n### Options\r\n\r\nUser can define in its prefered |vimrc| some options.\r\n\r\n#### g:magit_enabled\r\n\r\nTo enable or disable vimagit plugin.\r\nDefault value is 1.\r\n> let g:magit_enabled=[01]\r\n\r\n#### g:magit_show_help\r\n\r\nTo disable chatty inline help in magit buffer (default 1)\r\n> let g:magit_show_help=[01]\r\n\r\n#### g:magit_default_show_all_files\r\n\r\nWhen this variable is set to 0, all diff files are hidden by default.\r\nWhen this variable is set to 1, all diff for modified files are shown by default.\r\nWhen this variable is set to 2, all diff for all files are shown by default.\r\nDefault value is 1.\r\nNB: for repository with large number of differences, display may be slow.\r\n> let g:magit_default_show_all_files=[012]\r\n\r\n#### g:magit_default_fold_level\r\n\r\nDefault foldlevel for magit buffer.\r\nWhen set to 0, both filenames and hunks are folded.\r\nWhen set to 1, filenames are unfolded and hunks are folded.\r\nWhen set to 2, filenames and hunks are unfolded.\r\nDefault value is 1.\r\n> let g:magit_default_fold_level=[012]\r\n\r\n#### g:magit_default_sections\r\n\r\nWith this variable, the user is able to choose which sections are displayed in magit\r\nbuffer, and in which order.\r\nDefault value:\r\n> let g:magit_default_sections = ['info', 'global_help', 'commit', 'staged', 'unstaged']\r\n\r\n#### g:magit_warning_max_lines\r\n\r\nThis variable is the maximum number of diff lines that vimagit will display\r\nwithout warning the user. If the number of diff lines to display is greater than\r\nthis variable, vimagit will ask a confirmation to the user before refreshing the\r\nbuffer. If user answer is 'yes', vimagit will display diff lines as expected.\r\nIf user answer is 'no', vimagit will close all file diffs before refreshing.\r\nDefault value is 10000.\r\n> let g:magit_warning_max_lines=val\r\n\r\n## Installation\r\n\r\nThe plugin hierarchy tree respects the vim plugin standard. It is compatible\r\nwith pathogen (and most probably vundle).\r\n\r\nTo install:\r\n\r\n cd ~/.vim/bundle\r\n git clone https://github.com/jreybert/vimagit\r\n\r\n## Requirements\r\n\r\nThis part must be refined, I don't see any minimal version for git and vim, but for sure there should be one.\r\n\r\nAt least, it is tested with vim 7.3.249 and git 1.8.5.6 (see [Integration](#integration)).\r\n\r\n## Credits\r\n\r\n* Obviously, big credit to [magit](https://github.com/magit/magit). For the moment, I am only copying their stage workflow, but I won't stop there! They have a lot of other good ideas.\r\n* Sign handling is based on [gitgutter](https://github.com/airblade/vim-gitgutter) work.\r\n* Command line completion is based on [hypergit](https://github.com/c9s/hypergit.vim) work.\r\n\r\n## License\r\n\r\nCopyright (c) Jerome Reybert. Distributed under the same terms as Vim itself. See :help license.\r\n","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."} \ No newline at end of file