Commit Graph

72 Commits

Author SHA1 Message Date
Andy Stewart
1725c13add Simplify installation instructions 2019-10-01 10:39:23 +01:00
Andy Stewart
0469b8435a Deprecate <Plug>... maps in favour of <Plug>(...) 2019-09-04 08:56:36 +01:00
Andy Stewart
88d396f1b4 Add :GitGutterQuickFix command.
It loads all hunks into the quickfix list.

Closes #617.
2019-08-28 11:59:19 +01:00
Andy Stewart
3d71ac7e14 Fix duplicate tag. 2019-08-28 10:24:58 +01:00
Andy Stewart
2980a162fc Minor docs update. 2019-08-28 09:23:39 +01:00
Andy Stewart
8bafd08ef4 Support diffs relative to the working tree.
Closes #558.
2019-08-28 09:22:06 +01:00
Andy Stewart
67c8cca890 Support Vim's popup windows for hunk previews.
Note this prevents staging partial hunks via the previw window.
2019-08-27 16:56:30 +01:00
Andy Stewart
f0f56b9569 Use floating windows for hunk previews on Neovim. 2019-08-27 16:02:51 +01:00
Andy Stewart
77fb3fd81e Enable :w in preview window to stage the hunk. 2019-08-21 10:27:23 +01:00
Andy Stewart
c351eb13cf Update docs. 2019-08-16 16:38:32 +01:00
Andy Stewart
afe94ede1b Do not use a dummy sign to keep the sign column open.
This removes the g:gitgutter_sign_column_always option.

Vim 7.4.2201 introduced the |signcolumn| option to configure when the
signcolumn is visible, building in behaviour which the plugin provided
manually.

Although it would be good to maintain this feature for older Vims, the
complexity added by the code outweighs the benefit of backward
compatibility.
2019-08-16 12:06:28 +01:00
Andy Stewart
b036fcf527 Stage part of any hunk.
See #279.
2019-08-13 15:57:22 +01:00
Andy Stewart
bc1d28db46 Allow staging part of an additions-only hunk.
See #279.
2019-08-12 17:19:05 +01:00
Andy Stewart
fef14f1d49 Ignore non-gitgutter signs by default on Neovim >= 0.4.0
See #627.
2019-08-12 10:03:59 +01:00
Dan Aloni
9bf988bd1d Add g:gitgutter_sign_allow_clobber to control clobbering.
I.e. how gitgutter handles non-gitgutter signs.

See #565, #627.

Co-authored-by: Andy Stewart <boss@airbladesoftware.com>
2019-08-10 07:29:15 +01:00
Andy Stewart
de200ffdd4 Document cmd.exe vulnerability where it can execute the wrong git.
See #508, #538.
2019-08-10 06:16:13 +01:00
delphinus
c9ef2cd3d0 Fix typo in existent doc 2019-08-08 16:40:35 +01:00
delphinus
eb89ba52dc Add doc for highlighting line numbers 2019-08-08 16:40:35 +01:00
Andy Stewart
e564c28b6a Add link in docs. 2019-08-08 16:32:18 +01:00
homestar
8985017094 Add g:gitgutter_preview_win_location option 2019-08-08 16:31:44 +01:00
Andy Stewart
e5936a22cf Fix tmux command. 2019-05-15 16:27:17 +01:00
Andy Stewart
a6174df8a2 Document getting focus events in tmux.
Solution by @astier.  Thanks!

See #612.
2019-05-15 16:25:45 +01:00
Andy Stewart
afa4f2ddf0 Use the Diff* highlight groups by default.
This change makes the plugin default to using the highlight groups
defined by the colorscheme instead of hardcoding its own foreground
colours.

If you liked the previous colours you can restore them by adding these
lines to your vimrc:

highlight GitGutterAdd    guifg=#009900 guibg=<X> ctermfg=2 ctermb=<Y>
highlight GitGutterChange guifg=#bbbb00 guibg=<X> ctermfg=3 ctermb=<Y>
highlight GitGutterDelete guifg=#ff2222 guibg=<X> ctermfg=1 ctermb=<Y>

– where you should replace <X> and <Y> are the background colour of your
SignColumn in the gui and the terminal respectively.

For example, with the solarized colorscheme and a dark background,
guibg=#073642 and ctermbg=0.

Closes #545, #560.
2019-01-25 17:27:08 +00:00
Andy Stewart
ac787afa02 Add GitGutterFold command.
Closes #286, #571.
2019-01-14 11:48:24 +00:00
Andy Stewart
d2d2da11c5 Add g:gitgutter_git_args for args to git when running git-diff.
See #541, #546.
2018-07-31 14:28:36 +01:00
Martin Bukatovic
a986ab0547 Update FAQ in vim doc: refresh on file save 2018-06-01 21:31:52 +02:00
Andy Stewart
c39a5c240a Add g:gitgutter_terminal_reports_focus to enable FocusGained workaround.
See #490.
2018-02-28 15:09:36 +00:00
Andy Stewart
4a66a09658 Document dependency on focus events. 2018-02-28 11:43:00 +00:00
Daniel Hahler
10254400c3 doc: fix example for g:gitgutter_diff_args 2018-02-21 11:35:53 +00:00
Daniel Hahler
a046b5ace1 Improve GitGutter User autocommand: context/unsilent
This provides `g:gitgutter_hook_context` during the hook's execution and
removes the `:silent`, but uses `exists()` instead.

The bufnr might be necessary to know in the User autocommand, e.g. to
clear some cache.
Not using`:silent` is good practice in general to not hide (wanted)
output and errors etc.
2018-02-21 11:23:02 +00:00
Andy Stewart
4692457ae2 Document how to disable realtime updates. 2018-02-19 14:31:59 +00:00
Andy Stewart
7e3f41cdec Update docs. 2018-02-16 12:54:04 +00:00
Andy Stewart
ec6e1e484b Update docs with changed grep option.
Thanks @ErichDonGubler.

Closes #467.
2018-02-16 10:52:24 +00:00
Andy Stewart
5bfe5b9209 Big refactor.
- Hunk stage/undo/preview no longer saves the buffer.
- Hunk undo no longer makes locations go out of sync.
- Grep can be opted out of (grep output with ansi escapes is number one cause
  of issues).
- Replaced g:gitgutter_grep_command with g:gitgutter_grep.
- Always runs git-diff the same way instead of in two possible ways.
- Separated detection of git tracking from diffing.
- Simplified path handling.
- Removed support for xolox shell: Windows taskbar does not flash with async
  jobs.
- Removed g:gitgutter_{eager,realtime}.
- Simplified implementation generally.
2018-02-12 14:25:11 +00:00
Andy Stewart
9ecce5a269 Do not use --color=never flag for grep.
See #410.
2017-04-03 13:30:23 +01:00
Andy Stewart
092369c19c Use plain grep instead of extended grep.
See #410.
2017-04-03 13:23:50 +01:00
Alfredo Canziani
eaea1c5bba Fix help tag. 2016-11-29 16:22:19 +00:00
Alfredo Canziani
eb896b3598 Improve documentation
Add `:pclose` and `CTRL-W CTRL-Z` commands to `:GitGutterPreviewHunk` description.
2016-11-27 12:10:00 -05:00
Andy Stewart
90c558b1dc Expand installation instructions. 2016-05-18 16:35:04 +01:00
Christian Persson
b3979e7736 Fix typo in table of contents 2016-05-18 15:33:23 +01:00
Andy Stewart
f03a1a1f02 Document the autocmd. 2016-05-06 16:32:29 +01:00
Andy Stewart
e607a997ce Asynchronous diffs in Vim. 2016-04-29 09:50:57 +01:00
Andy Stewart
e48824cd1d Provide a hunk text object. 2016-04-21 14:08:14 +01:00
Andy Stewart
b3db866aab Use "undo" instead of "revert" for discarding a hunk.
"Undo" is a better name than "revert" because:

- "revert" sounds like it has something to do with `git-revert` but they
  are entirely different;
- "undo" is consistent with vim's "undo": discarding changes and going
  back to the original.

Maintain backwards compatibility and add deprecation warnings.

Closes #306.
2016-04-21 11:40:27 +01:00
Andy Stewart
530bf68fca Add option to disable asynchronous diffs.
Closes #318.
2016-04-21 10:29:11 +01:00
Andy Stewart
75eee3e407 Enable diffing against any commit.
Closes #309.
2016-04-20 11:19:34 +01:00
Dan Church
3131bdcbb8 Remove feature gitgutter_escape_grep
Reverts feature introduced in 5c23cadf57

In order to use an escaped grep, please replace
`g:gitgutter_escape_grep=1` with:

    let g:gitgutter_grep_command = '\grep --color=never -e'
2016-01-28 15:01:37 +00:00
Dan Church
8d229c222c Clean up exposure of the grep command
This change breaks up the determining of the user's grep command, and
the arguments it sends it.

Configuration is now:

    let g:gitgutter_grep_command = 'grep --color=never -e'

This makes it easier for users to configure now, though not quite as
flexible.
2016-01-28 15:01:37 +00:00
Dan Church
95734c6f6b Add support for option g:gitgutter_grep_command
With this change, setting `g:gitgutter_grep_command` to ' | grep --color=never -e "^@@ "'`
greatly reduces startup time.

Before this change, `diff.vim` was a major bottleneck because it calls
`grep --help`. This is mostly unnecessary except in a few cases where
the user is running a nonstandard version of grep.

`vim --startuptime start.out large_file.sql` before:

    times in msec
     clock   self+sourced   self:  sourced script
     clock   elapsed:              other lines

    000.026  000.026: --- VIM STARTING ---
    [...]
    068.463  003.645  003.500: sourcing /home/dchurch/.vim/plugin/gitgutter.vim
    [...]
    150.957  000.208  000.208: sourcing /home/dchurch/.vim/autoload/gitgutter.vim
    151.294  000.196  000.196: sourcing /home/dchurch/.vim/autoload/gitgutter/utility.vim
    165.059  012.619  012.619: sourcing /home/dchurch/.vim/autoload/gitgutter/diff.vim
    236.901  000.188  000.188: sourcing /home/dchurch/.vim/autoload/gitgutter/hunk.vim
    237.289  000.233  000.233: sourcing /home/dchurch/.vim/autoload/gitgutter/sign.vim
    [...]
    337.673  000.004: --- VIM STARTED ---

After change, and setting `g:gitgutter_grep_command = ' | grep --color=never -e "^@@ "'`:

    000.026  000.026: --- VIM STARTING ---
    [...]
    064.873  002.713  002.591: sourcing /home/dchurch/.vim/plugin/gitgutter.vim
    [...]
    134.109  000.149  000.149: sourcing /home/dchurch/.vim/autoload/gitgutter.vim
    134.337  000.147  000.147: sourcing /home/dchurch/.vim/autoload/gitgutter/utility.vim
    135.411  000.232  000.232: sourcing /home/dchurch/.vim/autoload/gitgutter/diff.vim
    187.831  000.180  000.180: sourcing /home/dchurch/.vim/autoload/gitgutter/hunk.vim
    188.223  000.175  000.175: sourcing /home/dchurch/.vim/autoload/gitgutter/sign.vim
    [...]
    285.008  000.004: --- VIM STARTED ---
2016-01-28 15:01:37 +00:00
Andy Stewart
51d9a3f2bc Clarify mappings. 2015-11-17 11:06:25 +00:00