This repository has been archived by the owner on Sep 21, 2019. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgita.txt
1871 lines (1517 loc) · 58.8 KB
/
gita.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
*gita.txt* A git manipulation plugin
Version: 0.1.5
Author: Alisue <[email protected]> *gita-author*
Support: Vim 7.4 and above
License: MIT license
Copyright (c) 2014-2016 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.
=============================================================================
CONTENTS *gita-contents*
Introduction |gita-introduction|
Install |gita-install|
Usage |gita-usage|
Status |gita-usage-status|
Patch |gita-usage-patch|
Conflict |gita-usage-conflict|
Commit |gita-usage-commit|
Changes |gita-usage-changes|
Search |gita-usage-search|
List |gita-usage-list|
Branch |gita-usage-branch|
Browse |gita-usage-browse|
Blame |gita-usage-blame|
Statusline |gita-usage-statusline|
Interface |gita-interface|
Commands |gita-interface-commands|
Functions |gita-interface-functions|
Variables |gita-interface-variables|
Actions |gita-interface-actions|
Autocmds |gita-interface-autocmds|
FAQ |gita-faq|
==============================================================================
INTRODUCTION *gita-introduction*
*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 (git add/git rm)
- Unstage content changes from the index (git reset)
- Partially stage content changes into the index (git add -p)
- Partially unstage content changes from the index (git reset -p)
- Solve conflict files 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 *gita-install*
Use your favorite Vim plugin manager such as junegunn/vim-plug,
Shougo/dein.vim or whatever like:
>
" vim-plug
Plug 'lambdalisue/vim-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 *gita-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 a manipulation window (e.g. |gita-status|) shows
action and mapping helps.
------------------------------------------------------------------------------
STATUS *gita-usage-status*
To check or modify current statuses of a git repository, use |:Gita-status|
command like:
>
:Gita status
<
It opens a *gita-status* window which looks like:
>
┌ A repository name
│ ┌ A local branch name
│ │ ┌ A remote name
│ │ │ ┌ A remote branch name
│ │ │ │
status of gita/alpha-3 <> origin/alpha-3 | Press ? ...
M autoload/gita/command.vim
M doc/gita.txt
│ │
│ └ A modified filename
└ A current status of a file (Short formt)
<
The status of each modified files are shown as short format. If you are not
familiar with short format, check a |gita-usage-status-cheetsheet| or
a manpage of git-status.
*gita-usage-status-cheetsheet*
X Y Meaning ~
[MD] not updated
M [ MD] updated in index
A [ MD] added to index
D [ M] deleted from index
R [ MD] renamed in index
C [ MD] copied in index
[MARC] index and work tree matches
[ MARC] M work tree changed since index
[ MARC] D deleted in work tree
D D unmerged, both deleted
A U unmerged, added by us
U D unmerged, deleted by them
U A unmerged, added by them
D U unmerged, deleted by us
A A unmerged, both added
U U unmerged, both modified
? ? untracked
! ! ignored
In that window, users can manipulate or check statuses by the following
mappings:
*gita-usage-status-mapping*
Key Description ~
? Show an action and mapping help
<Tab> Select an action to perform
<< Stage changes of a file
>> Unstage changes of a file
-- Toggle stage/unstage of a file
bb Start a system browser to show the remote URL
pp Start a patch (partially stage/unstage changes)
!! Start a chaperone (help to solve conflicts)
BB Start a blame (a gita style blame)
ee Edit a working tree file
EE Edit a working tree file (split to right)
et Edit a working tree file (in a new tabpage)
ep Edit a working tree file (in a preview window)
ss Show a content of the file in the index
SS Show a content of the file in the index (right)
st Show a content of the file in the index (tabpage)
sp Show a content of the file in the index (window)
dd Show a diff to the index
DD Show a diff to the index (right)
dt Show a diff to the index (tabpage)
dp Show a diff to the index (preview)
ds Open vimdiff (two buffers) to the index
DS Open vimdiff (two buffers) to the index (tabpage)
<CR> Same as ee
<C-^> Switch to |gita-commit| window
Note that the mapping table above is partial. Hit ? on the window to see a
full mapping table.
A general workflow is:
1. Open a |gita-status| window by :Gita status
2. Hit dp to check if the changes are correct
3. Hit ee/EE to edit codes
4. Hit pp to patch changes to the index or << to stage entire content
5. Hit <C-^> to switch to a |gita-commit| window
See |gita-usage-commit| for the further workflow.
------------------------------------------------------------------------------
PATCH *gita-usage-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:
>
:Gita patch
<
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.
Users can obtain changes from HEAD or Working tree by the following mappings:
*gita-usage-patch-INDEX-mapping*
Key Description ~
dol Obtain a diff chunk from HEAD (left)
dor Obtain a diff chunk from Working tree (right)
<C-l> Perform |diffupdate| and |redraw()|
In HEAD or Working tree window, the following mappings are available:
*gita-usage-patch-HEAD-mapping*
*gita-usage-patch-WORKTREE-mapping*
Key Description ~
dp Put a diff chunk to Index
<C-l> Perform |diffupdate| and |redraw()|
Once you patch changes, see |gita-usage-commit| to commit changes.
Note that if you prefer to use 1-way (edit a single diff file) or 2-way (open
two buffer HEAD vs Index or Index vs Working tree) patch, see |:Gita-patch|
for a corresponding option.
------------------------------------------------------------------------------
CONFLICT *gita-usage-conflict*
*gita-usage-chaperone*
If you have several conflicted files, use |:Gita-chaperone| command on a
conflicted file buffer like:
>
:Gita chaperone
<
It opens three |vimdiff| windows which indicates a contents of
1. LOCAL (gita://<refname>:show/:2:<filename>)
2. MERGE (<filename>)
3. REMOTE (gita://<refname>:show/:3:<filename>)
In MERGE window, all conflict markers (e.g. <<<<<<< HEAD) are removed and a
content of an ancestor commit between LOCAL and REMOTE are written
automatically. Users can then obtain changes from LOCAL or REMOTE by the
following mappings:
*gita-usage-chaperone-MERGE-mapping*
Key Description ~
dol Obtain a diff chunk from LOCAL (ours)
dor Obtain a diff chunk from REMOTE (theirs)
<C-l> Perform |diffupdate| and |redraw()|
In LOCAL or REMOTE window, the following mappings are available:
*gita-usage-chaperone-LOCAL-mapping*
*gita-usage-chaperone-REMOTE-mapping*
Key Description ~
dp Put a diff chunk to MERGE
<C-l> Perform |diffupdate| and |redraw()|
Once you solve conflicts, see |gita-usage-status| to stage changes.
Note that if you prefer to use 1-way (edit a single diff file) or 2-way (open
two buffer LOCAL vs MERGE or MERGE vs REMOTE) chaperone, see |:Gita-chaperone|
for a corresponding option.
------------------------------------------------------------------------------
COMMIT *gita-usage-commit*
To commit changes in the index, use |:Gita-commit| command like:
>
:Gita commit
<
It opens a *gita-commit* window which looks like:
>
┌ A repository name
│ ┌ A local branch name
│ │ ┌ A remote name
│ │ │ ┌ A remote branch name
│ │ │ │
# status of gita/alpha-3 <> origin/alpha-3 | Press ? ...
# M autoload/gita/command.vim
# M doc/gita.txt
# │ │
# │ └ A modified filename
# └ A current status of a file (Short form)
<
The status of each modified files are shown as short format. If you are not
familiar with short format, check a |gita-usage-status-cheetsheet| or
a manpage of git-status.
In that window, users can edit a commit message and commit the changes by the
following mappings:
*gita-usage-commit-mapping*
Key Description ~
? Show an action and mapping help
<Tab> Select an action to perform
bb Start a system browser to show the remote URL
BB Start a blame (a gita style blame)
ee Edit a working tree file
EE Edit a working tree file (split to right)
et Edit a working tree file (in a new tabpage)
ep Edit a working tree file (in a preview window)
ss Show a content of the file in the index
SS Show a content of the file in the index (right)
st Show a content of the file in the index (tabpage)
sp Show a content of the file in the index (window)
dd Show a diff to the index
DD Show a diff to the index (right)
dt Show a diff to the index (tabpage)
dp Show a diff to the index (preview)
ds Open vimdiff (two buffers) to the index
DS Open vimdiff (two buffers) to the index (tabpage)
<CR> Same as dd
<C-^> Switch to |gita-status| window
<C-c><C-n> Re-open |gita-commit| window without --amend option
<C-c><C-a> Re-open |gita-commit| window with --amend option
<C-c><C-c> Commit changes
Note that the mapping table above is partial. Hit ? on the window to see a
full mapping table.
A general workflow is:
1. Hit dp to check if the changes are correct
2. Write a commit message
3. Close the window by :wq and answer 'y' to commit
Note that when the window is going to close, gita ask users to wheter user
want to commit the changes or not. The default value of that prompt is 'y' so
users can commit by hitting <Return> or cancel by <Esc> at that point. Or
explicitly commit by hitting <C-c><C-c>.
------------------------------------------------------------------------------
CHANGES *gita-usage-changes*
*gita-usage-diff-ls*
To see which files are changed from a particular commit such as an ancestor
commit of a current branch (a fork-point of a branch from remote HEAD), use
|:Gita-diff-ls| command like:
>
:Gita diff-ls origin/HEAD...
<
It opens a *gita-diff-ls* window for origin/HEAD... which looks like:
>
206 files are different between origin/HEAD... and HEAD | Press ? ...
.travis.yml +21 -25 +--
appveyor.yml +22 -45 ++----
│ │ │ │
│ │ │ └ A visual indicator
│ │ └ Deleted lines
│ └ Added lines
└ A modified filename
<
In that window, users can find which files are changed and open these files by
following mappings:
*gita-usage-diff-ls-mapping*
Key Description ~
? Show an action and mapping help
<Tab> Select an action to perform
bb Start a system browser to show the remote URL
BB Start a blame (a gita style blame)
ee Edit a working tree file
EE Edit a working tree file (split to right)
et Edit a working tree file (in a new tabpage)
ep Edit a working tree file (in a preview window)
ss Show a content of the file in the index
SS Show a content of the file in the index (right)
st Show a content of the file in the index (tabpage)
sp Show a content of the file in the index (window)
dd Show a diff to the index
DD Show a diff to the index (right)
dt Show a diff to the index (tabpage)
dp Show a diff to the index (preview)
ds Open vimdiff (two buffers) to the index
DS Open vimdiff (two buffers) to the index (tabpage)
<CR> Same as dd
Note that the mapping table above is partial. Hit ? on the window to see a
full mapping table.
------------------------------------------------------------------------------
SEARCH *gita-usage-search*
*gita-usage-grep*
To search content in a repository, use |:Gita-grep| command like:
>
:Gita grep autoload
<
It opens *gita-grep* window with 'foobar', which looks like:
>
┌ A blob name (commit or branch)
│ ┌ A repository name
│ │
372 matches in INDEX of gita | Press ? to show help or <Tab> ...
.travis.yml:35 - sh /tmp/vim-vimlint/bin/vimlint.sh -l ...
README.md:77 \ 'autoload': {
│ │ │
│ │ └ A line content
│ └ A line number
└ A filename
<
In that window, users can find which files contains the specified pattern(s)
and open files by following mappings:
*gita-usage-grep-mapping*
Key Description ~
? Show an action and mapping help
<Tab> Select an action to perform
bb Start a system browser to show the remote URL
BB Start a blame (a gita style blame)
ee Edit a working tree file
EE Edit a working tree file (split to right)
et Edit a working tree file (in a new tabpage)
ep Edit a working tree file (in a preview window)
ss Show a content of the file in the index
SS Show a content of the file in the index (right)
st Show a content of the file in the index (tabpage)
sp Show a content of the file in the index (window)
dd Show a diff to the index
DD Show a diff to the index (right)
dt Show a diff to the index (tabpage)
dp Show a diff to the index (preview)
ds Open vimdiff (two buffers) to the index
DS Open vimdiff (two buffers) to the index (tabpage)
<CR> Same as ss
Note that the mapping table above is partial. Hit ? on the window to see a
full mapping table.
------------------------------------------------------------------------------
LIST *gita-usage-list*
*gita-usage-ls-files*
*gita-usage-ls-tree*
To list files in a working tree, use |:Gita-ls-files| command like:
>
:Gita ls-files
<
It opens a *gita-ls-files* window which looks like:
>
┌ A repository name
│
148 files in gita | Press ? to show help or <Tab> to select ...
LICENSE.md
README.md
│
└ A filename
<
To list files in a particular blog (commit, branch, etc.), use |:Gita-ls-tree|
command like:
>
:Gita ls-tree develop
<
It opens a *gita-ls-tree* window for 'develop' branch which looks like:
>
┌ A blob name (commit or branch)
│ ┌ A repository name
│ │
148 files in develop of gita | Press ? to show help or <Tab> ...
LICENSE.md
README.md
│
└ A filename
<
In both windows, users can open files by following mappings:
*gita-usage-ls-files-mapping*
*gita-usage-ls-tree-mapping*
Key Description ~
? Show an action and mapping help
<Tab> Select an action to perform
bb Start a system browser to show the remote URL
BB Start a blame (a gita style blame)
ee Edit a working tree file
EE Edit a working tree file (split to right)
et Edit a working tree file (in a new tabpage)
ep Edit a working tree file (in a preview window)
ss Show a content of the file in the index
SS Show a content of the file in the index (right)
st Show a content of the file in the index (tabpage)
sp Show a content of the file in the index (window)
dd Show a diff to the index
DD Show a diff to the index (right)
dt Show a diff to the index (tabpage)
dp Show a diff to the index (preview)
ds Open vimdiff (two buffers) to the index
DS Open vimdiff (two buffers) to the index (tabpage)
<CR> Same as ee (ls-files) or ss (ls-tree)
Note that the mapping table above is partial. Hit ? on the window to see a
full mapping table.
------------------------------------------------------------------------------
BRANCH *gita-usage-branch*
To manipulate or switch brahcn, use |:Gita-branch| command like:
>
:Gita branch
<
It opens a *gita-branch* window which looks like:
>
┌ A repository name
│
3 branches in gita | Press ? to show help or <Tab> to ...
* alpha-3
master
│ │
│ └ A branch name
└ A current branch marker
<
In that window, users can manipulate or check statuses by the following
mappings:
*gita-usage-branch-mapping*
Key Description ~
? Show an action and mapping help
<Tab> Select an action to perform
rr Rename branch
RR Rename branch (force)
dd Delete branch
DD Delete branch (force)
co Checkout branch
ct Checkout branch (track)
<CR> Same as ct
Note that the mapping table above is partial. Hit ? on the window to see a
full mapping table.
A general workflow is:
1. Open a |gita-branch| window by :Gita branch
2. Hit <CR> to switch the branch
3. Hit <Tab> to select action (e.g. merge)
------------------------------------------------------------------------------
BROWSE *gita-usage-browse*
To browse a remote content of a file (e.g. GitHub), use |:Gita-browse| command
like:
>
:Gita browse
<
It start a system browser with a corresponding remote URL. If you would like
to open a repository root URL instead of a file content URL, use --repository
option like:
>
:Gita browse --repository
<
Additionally, |:Gita-browse| supports several schemes to slightly change a
remote URL. Use --scheme={scheme} option to specify it. The followings are
available schemes in default.
Scheme Description ~
exact Use a hashref instead of branch name
blame Open blame page instead of content page
diff Open diff page instead of content page (BitBucket.org)
A remote URL is constructed by translating patterns written in
|g:gita#command#browse#translation_patterns|. See that help to add your
original translation patterns (e.g. patterns for GitHub Enterprise).
------------------------------------------------------------------------------
BLAME *gita-usage-blame*
To blame, use |:Gita-blame| command on a file buffer like:
>
:Gita blame
<
It opens a *gita-blame-navi* window and *gita-blame-view* window. Contents of
the both windows are separated by commit chunks and a commit chunk in a
|gita-blame-navi| window looks like:
>
┌ An actual line number
│ ┌ A commit message
│ │
111 Simplify diff-ls
112 lambdalisue authored 1 day ago bcb41c6
│ │ │
│ │ └ A revision
│ └ A commit date
└ A commit author
<
In a |gita-blame-navi| window, the following mappings are available:
*gita-usage-blame-navi-mapping*
Key Description ~
? Show an action and mapping help
<Tab> Select an action to perform
bb Start a system browser to show the remote URL
ee Edit a working tree file
EE Edit a working tree file (split to right)
et Edit a working tree file (in a new tabpage)
ep Edit a working tree file (in a preview window)
ss Show a content of the file in the index
SS Show a content of the file in the index (right)
st Show a content of the file in the index (tabpage)
sp Show a content of the file in the index (window)
dd Show a diff to the index
DD Show a diff to the index (right)
dt Show a diff to the index (tabpage)
dp Show a diff to the index (preview)
ds Open vimdiff (two buffers) to the index
DS Open vimdiff (two buffers) to the index (tabpage)
BB Enter a (previous) commit of the chunk
<BS> Back to a previous blame content
]c Jump to a next commit chunk
[c Jump to a previous commit chunk
<CR> Same as BB
In a |gita-blame-view| window, the following mappings are available:
*gita-usage-blame-view-mapping*
Key Description ~
? Show an action and mapping help
<Tab> Select an action to perform
BB Enter a (previous) commit of the chunk
<BS> Back to a previous blame content
]c Jump to a next commit chunk
[c Jump to a previous commit chunk
<CR> Same as BB
Note that the mapping table above is partial. Hit ? on the window to see a
full mapping table.
------------------------------------------------------------------------------
STATUSLINE *gita-usage-statusline*
gita provides a statusline components which returns a |String| available in
|statusline|.
The components aggressively cache statuses to improve the performance so you
would notice a huge performance improvement if you are currently using
|system()| to get git informations.
Use |gita#statusline#preset()| to get presets or |gita#statusline#format()| to
create your own components like:
>
echo gita#statusline#preset('branch')
" => 'gita/master <> origin/master'
echo gita#statusline#preset('status')
" => '!5 +2 "4 *4'
echo gita#statusline#preset('traffic')
" => '<5 >4'
echo gita#statusline#format('%ln/%lb # %rn/%rb')
" => 'gita/master # origin/master'
<
Use components above to customize your |statusline| like:
>
let &statusline = &statusline . "%{gita#statusline#preset('branch')}"
<
The code above add a current branch name to the end of your statusline.
==============================================================================
INTERFACE *gita-interface*
------------------------------------------------------------------------------
COMMANDS *gita-interface-commands*
*:GitaClear*
:GitaClear
Clear a git repository cache of the current buffer.
You should not be required to call this command unless you remove .git
directory or execute git init out side of Vim.
Note that you may miss that |:edit| or |:edit!| reload the content of
the buffer so use these command to update content.
*:Gita*
:Gita[!] {args}
Execute a git command. If a bang (!) is specified, it executes a git
command by |:!|. Otherwise it uses Vital.System.Process.execute()
which may use |system()| or vimproc#system() internally.
Note that a bang is required to execute an interactive command (such
as "git rebase -i") in a console vim. In a GUI Vim, most of
interactive commands would crash a screen in a Unix system.
A {args} will be split with non escaped and non enclosed spaces.
So use one of the following pattern to apply space containing value to
options.
>
:Gita tag -a v1.0.0 -m 'Version 1.0.0'
:Gita tag -a v1.0.0 -m "Version 1.0.0"
:Gita tag -a v1.0.0 -m Version\ 1.0.0
<
Note that each values split from {args} are expanded by
|gita#meta#expand()| and all escaped spaces in {args} will be
un-escaped.
Note that :Gita command does not support |command-bar|. See FAQ if you
really need a support of |command-bar|.
*:Gita-blame*
:Gita blame [-h/--help]
[--opener={opener}] [--selection={selection}]
[{commit}] [{filename}]
Open |gita-blame-navi| window and |gita-blame-view| window.
See |gita-usage-blame| for the usage.
A {opener} is used to open new buffers.
See |g:gita#content#blame#default_opener| for the default opener.
A {selection} is used to specify line numbers to move.
A format of the {selection} is --selection=N or --selection=N-M where
the N is a start line number and the M is a end line number.
If {commit} is omitted, an index content is used.
If {filename} is omitted, a corresponding filename of the current
buffer is used.
*:Gita-branch*
:Gita branch [-h/--help]
[--opener={opener}] [--selection={selection}] {options}
Open a |gita-branch| window.
See |gita-usage-branch| for the usage and see :Gita branch -h for
available {options}.
A {opener} is used to open a new buffer.
See |g:gita#content#branch#default_opener| for the default opener.
A {selection} is used to specify line numbers to move.
A format of the {selection} is --selection=N or --selection=N-M where
the N is a start line number and the M is a end line number.
*:Gita-browse*
:Gita browse [-h/--help]
[-r/--repository] [-s/--scheme={scheme}]
[--[no-]open] [--[no-]yank]
[--selection={selection}] [{commit}] [-- {path}]
Open a remote URL of {path} in {commit} with a system default browser.
See |gita-usage-browse| for the usage.
If {path} is omitted, a corresponding filename of the current buffer
will be used.
If {commit} is omitted, a corresponding remote branch of the current
local branch will be used.
A {selection} is used to specify line numbers to move.
A format of the {selection} is --selection=N or --selection=N-M where
the N is a start line number and the M is a end line number.
When {scheme} is specified, a URL of a specified {scheme} will be
used. The following {scheme} is available in default.
Scheme Description ~
_ A default scheme
^ A default scheme for --repository
exact Use a hashref instead of branch name
blame Open blame page instead of content page
diff Open diff page instead of content page (available only
for bitbucket.org rule)
Note that users can add them original {scheme} or original rules
to pattern variable.
See |g:gita#command#browse#extra_translation_patterns| for detail.
*:Gita-chaperone*
:Gita chaperone [-h/--help]
[--opener={opener}] [--selection={selection}]
[--two] [--three]
[{path}]
Open two or three buffers to solve conflicts.
See |gita-usage-chaperone| for the usage.
A {opener} is used to open new buffers.
See |g:gita#content#chaperone#default_opener| for the default opener.
A {selection} is used to specify line numbers to move.
A format of the {selection} is --selection=N or --selection=N-M where
the N is a start line number and the M is a end line number.
If {path} is omitted, a corresponding filename of the current
buffer will be used.
A split direction can be controlled by |vertical| prefix like:
>
:vertical Gita chaperone ...
<
Or if you want to always split vertically, add vertical to |diffopt|.
*:Gita-commit*
:Gita commit [-h/--help] [--opener={opener}] {options} [-- {path}...]
Open a |gita-commit| window.
See |gita-usage-commit| for the usage and see :Gita commit -h for
available {options}.
A {opener} is used to open a new buffer.
See |g:gita#content#commit#default_opener| for the default opener.
If {path}(s) is/are specified, it filter candidates to the
specified {path}(s).
*:Gita-diff*
:Gita diff [-h/--help]
[--split] [--opener={opener}] [--selection={selection}]
{options}
[{commit}] [-- {path}]
Open a diff buffer to compare differences.
See :Gita diff -h for available {options}.
When no {path} is specified, it show a diff of the repository with
unified diff.
When --split is specified, it open two buffers to compare difference
rather than using unified-diff style (|vimdiff| style).
A {opener} is used to open (a) new buffer(s).
See |g:gita#content#diff#default_opener| for the default opener.
A {selection} is used to specify line numbers to move.
A format of the {selection} is --selection=N or --selection=N-M where
the N is a start line number and the M is a end line number.
When {commit} is omitted, an index is used.
A split direction could be controlled by |vertical| prefix like:
>
:vertical Gita diff ...
<
Or if you want to always split vertically, add vertical to |diffopt|.
*Gita-diff-ls*
:Gita diff-ls [-h/--help] [--opener={opener}] [{commit}]
Open a |gita-diff-ls| window.
See |gita-usage-diff-ls| for the usage.
A {opener} is used to open a new buffer.
See |g:gita#content#diff_ls#default_opener| for the default opener.
When {commit} is omitted, an index is used.
*:Gita-grep*
:Gita grep [-h/--help] {options} [--opener={opener}] {patterns}
Open a |gita-grep| window.
See |gita-usage-grep| for the usage and :Gita grep -h for
available {options}.
A {opener} is used to open a new buffer.
See |g:gita#content#grep#default_opener| for the default opener.
*Gita-ls-files*
:Gita ls-files [-h/--help] {options} [--opener={opener}] [-- {path}...]
Open a |gita-ls-files| window.
See |gita-usage-ls-files| for the usage and :Gita ls-files -h for
available {options}.
A {opener} is used to open a new buffer.
See |g:gita#content#ls_files#default_opener| for the default opener.
When {path}(s) is/are specified, the result will be filetred by
{path}(s).
*:Gita-ls-tree*
:Gita ls-tree [-h/--help] [--opener={opener}] {commit} [-- {path}...]
Open a |gita-ls-tree| window.
See |gita-usage-ls-tree| for the usage.
A {opener} is used to open a new buffer.
See |g:gita#content#ls_tree#default_opener| for the default opener.
When {path}(s) is/are specified, the result will be filetred by
{path}(s).
*:Gita-patch*
:Gita patch [-h/--help]
[--opener={opener}] [--selection={selection}]
[--reverse] [--one] [--two] [--three]
[{path}]
Open one, two, or three buffers to patch changes to the index (like
git add -p / git reset -p).
See |gita-usage-patch| for the usage.
A {opener} is used to open new buffers.
See |g:gita#content#patch#default_opener| for the default opener.
A {selection} is used to specify line numbers to move.
A format of the {selection} is --selection=N or --selection=N-M where
the N is a start line number and the M is a end line number.
If {path} is omitted, a corresponding filename of the current
buffer will be used.
A split direction can be controlled by |vertical| prefix like:
>
:vertical Gita patch ...
<
Or if you want to always split vertically, add vertical to |diffopt|.
*:Gita-show*
:Gita show [-h/--help]
[-w/--worktree] [-1/--ancestor] [-2/--ours] [-3/--theris]
[--opener={opener}] [--selection={selection}]
[{commit}] [-- {path}]
Open a buffer of a corresponding content.
When no {path} is specified, it show a current status of the
repository with unified diff.
When --worktree is specified, it open a corresponding file in the
working tree directly.
When --ancestor, --ours, or --theirs is specified during MERGE mode,