From 8a2f8199b689b93fe4391a8ba1d97dd84b86ebd6 Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Fri, 14 Jul 2023 14:29:31 +0100 Subject: [PATCH] Document 'updatetime' and 'signcolumn' more prominently --- README.mkd | 11 ++++++++--- doc/gitgutter.txt | 13 ++++++++++++- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.mkd b/README.mkd index f948dd8..82e65bd 100644 --- a/README.mkd +++ b/README.mkd @@ -55,7 +55,7 @@ In the screenshot above you can see: ### Installation -Install using your favourite package manager, or use Vim's built-in package support. +First, install using your favourite package manager, or use Vim's built-in package support. Vim: @@ -68,7 +68,6 @@ vim -u NONE -c "helptags vim-gitgutter/doc" -c q Neovim: - ``` mkdir -p ~/.config/nvim/pack/airblade/start cd ~/.config/nvim/pack/airblade/start @@ -76,6 +75,12 @@ git clone https://github.com/airblade/vim-gitgutter.git nvim -u NONE -c "helptags vim-gitgutter/doc" -c q ``` +Second, ensure your `updatetime` and `signcolumn` options are set appropriately. + +When you make a change to a file tracked by git, the diff markers should appear automatically after a short delay. The delay is governed by vim's `updatetime` option; the default value is `4000`, i.e. 4 seconds, but I suggest reducing it to around 100ms (add `set updatetime=100` to your vimrc). Note `updatetime` also controls the delay before vim writes its swap file (see `:help updatetime`). + +The `signcolumn` option can have any value except `'off'`. + ### Windows @@ -93,7 +98,7 @@ Unfortunately I don't know the correct escaping for the path - if you do, please ### Getting started -When you make a change to a file tracked by git, the diff markers should appear automatically. The delay is governed by vim's `updatetime` option; the default value is `4000`, i.e. 4 seconds, but I suggest reducing it to around 100ms (add `set updatetime=100` to your vimrc). Note `updatetime` also controls the delay before vim writes its swap file (see `:help updatetime`). +When you make a change to a file tracked by git, the diff markers should appear automatically after a short delay. You can jump between hunks with `[c` and `]c`. You can preview, stage, and undo hunks with `hp`, `hs`, and `hu` respectively. diff --git a/doc/gitgutter.txt b/doc/gitgutter.txt index 5efc73c..bb93067 100644 --- a/doc/gitgutter.txt +++ b/doc/gitgutter.txt @@ -41,7 +41,8 @@ one in 2013. =============================================================================== INSTALLATION *gitgutter-installation* -Use your favourite package manager, or use Vim's built-in package support. +First, use your favourite package manager, or use Vim's built-in package +support. Vim:~ > @@ -59,6 +60,16 @@ Neovim:~ nvim -u NONE -c "helptags vim-gitgutter/doc" -c q < +Second, ensure your 'updatetime' and 'signcolumn' options are set appropriately. + +When you make a change to a file tracked by git, the diff markers should +appear automatically after a short delay. The delay is governed by vim's +'updatetime' option; the default value is `4000`, i.e. 4 seconds, but I +suggest reducing it to around 100ms (add `set updatetime=100` to your vimrc). +Note 'updatetime' also controls the delay before vim writes its swap file. + +The 'signcolumn' option can have any value except "off". + =============================================================================== WINDOWS *gitgutter-windows*