-
Notifications
You must be signed in to change notification settings - Fork 3
/
.vimrc.git-and-diff
120 lines (110 loc) · 5.17 KB
/
.vimrc.git-and-diff
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
" Plugins to work with git and diff
" From a very single vim buffer, you can perform all basic git operations. To name a few:
" Visualize all diffs in your git repository.
" Stage files/hunks/parts of hunks with single key S.
" Write or amend your commit message and commit.
"
" :Magit - open it
"
" ? inside Magit buffer to show help
"
" Useful: edit file and return to Magit:
" - gf on the file name to open file
" - do some changes
" - Ctrl-O to get back to Magit buffer
Plug 'jreybert/vimagit'
nnoremap <Leader>m :tabnew<CR>:MagitOnly<CR>
" :EnhancedDiff histogram | myers | patience | minimal | default
" and run :diffupdate
" :EnhancedDiffDisable - disable it
Plug 'chrisbra/vim-diff-enhanced'
" git support:
" :Git [add|status|commit|...] - run git command with enhanced vim support
" :Git blame - show git blame for current file, with history in a separate buffer
" ~ to re-blame the selected commit (go deeper back in history)
" - reblame at commit
" A resize to end of author column
" C resize to end of commit column
" D resize to end of date/time column
" gq close blame, then |:Gedit| to return to work tree version
" <CR> close blame, and jump to patch that added line
" o jump to patch or blob in horizontal split
" O jump to patch or blob in new tab
" p jump to patch or blob in preview window
" :Git - magit-like git interface
" = to expand diffs for the file
" - to stage/unstage the file or hunk under cursor (or s=stage and
" u=unstage)
" cc to commit (new buffer, add commit message and :wq to commit)
" :Gdiff - diff for current file (note: this is :Gdiffsplit now)
" :Gdiff [commit] to diff with a specific commit
" :Gedit - go back to the file if you in some git revistion buffer
" :GRemove, GMove - remove or move file and stage the change
" :GBrowse - open current file on github
" :Gclog - show git log for current file in the quickfix window
" :0Glog on a file to see versions for the specific file.
"
" Search in a specific directory:
" :Ggrep searchterm -- foldername | copen
" Search specific file types:
" :Ggrep searchterm -- '*.ext' | copen
"
" Git setup:
" mergetool.fugitive.cmd=gvim -f -c Gdiff $MERGED
" mergetool.fugitive.trustexitcode=true
Plug 'tpope/vim-fugitive'
" Enables Github for :GBrowse (open file on github)
Plug 'tpope/vim-rhubarb'
" Commit browser, based on fugitive.
" Useful to see the list of changes for the specific file.
" Execute :Extradite in the file buffer.
" <CR> edits the revision on the current line in a fugitive-buffer.
" oh, ov, and ot edit the revision under the cursor in a new horizontal split / vertical split / tab respectively.
" dh, dv, and dt diff the current file against the revision under the cursor in a new horizontal split / vertical split / tab respectively.
" t toggles the visibility of the file diff buffer.
" q closes the Extradite buffer.
Plug 'int3/vim-extradite'
" :Flog - git log viewer, based on fugitive
Plug 'rbong/vim-flog'
" :GitLog - git log viewer, based on fugitive
" Here are some commands you can use in the browser:
" - d View the side by side diff of any file by putting your cursor on that line and typing d (for diff).
" - <cr> View the diffstat from git show $revision for that commit.
" - f Move your cursor to the first filename in the next commit.
" - F Move your cursor to the first filename in the previous commit.
" - q Quit. Closes all the GitLog windows and buffers.
" To quickly exit out of a side by side diff and return to the 'GitLog' window, type q.
" There is also :Ribbon command to review new changes arrived after pull:
" - M Load more
" - First mark your place with `:RibbonSave`
" This will place a tag named __ribbon at origin/master. Basically you are bookmarking our current spot with a ribbon.
" - Pull changes `:Git pull`
" - To review those changes use the following command: `:Ribbon`
" This will open a window titled 'Ribbon' with the log of changes.
" see http://gitready.com/advanced/2011/10/21/ribbon-and-catchup-reading-new-commits.html
"
Plug 'kablamo/vim-git-log'
" Shows +/- for git changes
" Additional features:
" - :SignifyDiff - show diff for current file (this can also be done with :Gsplitdiff)
" - :SignifyHunkDiff - show inline diff for current change under cursor
" - :SignifyHunkUndo - undo current change
" - :SignifyFold - fold code, keep only changes visible
" - :SignifyToggleHighlight - toggle diff higlight
Plug 'mhinz/vim-signify'
" :DirDiff <A:Src Directory> <B:Src Directory>
" see http://www.vim.org/scripts/script.php?script_id=102
" see the source and diff pane for features, for example,
" 'a' command lets to set diff arguments (like -w - ignore whitespace)
Plug 'zhaocai/DirDiff.vim'
" Show commit history in a popup, like an inline Gblame
" <Leader>gm to open
" And <Leader>gm once more to move cursor into the popup, here:
" - o / O - prev / next commit
" - d - show diff (current file)
" - D - show diff (all files in the commit)
" - q - close
" - ? - show help
Plug 'rhysd/git-messenger.vim'
" Improves the commit buffer - splits into diff, edit, status.
Plug 'rhysd/committia.vim'