Skip to content

Commit

Permalink
Make signs optional (on by default).
Browse files Browse the repository at this point in the history
  • Loading branch information
airblade committed Mar 28, 2013
1 parent 60ce94c commit 3243987
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
9 changes: 9 additions & 0 deletions README.mkd
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ You can customise:
* Line highlights
* Extra arguments for `git diff`
* Whether or not vim-gitgutter is on initially (defaults to on)
* Whether or not signs are shown (defaults to yes)
* Whether or not line highlighting is on initially (defaults to off)
* Whether or not vim-gitgutter runs on `BufEnter` (defaults to yes)
* Whether or not vim-gitgutter runs for all buffers on `FocusGained` (defaults to yes)
Expand Down Expand Up @@ -124,6 +125,14 @@ let g:gitgutter_sign_removed = 'zz'
let g:gitgutter_sign_modified_removed = 'ww'
```

#### Whether or not signs are shown

If you never want signs to be shown (presumably you only want the line highlights), add this to your `~/.vimrc`:

```viml
let g:gitgutter_signs = 0
```

#### Line highlights

Similarly to the signs' colours, set up the following highlight groups in your colorscheme or `~/.vimrc`:
Expand Down
8 changes: 8 additions & 0 deletions doc/gitgutter.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ You can customise:
- Line highlights
- Extra arguments for git-diff
- Whether or not vim-gitgutter is on initially (defaults to on)
- Whether or not signs are shown (defaults to yes)
- Whether or not line highlighting is on initially (defaults to off)
- Whether or not vim-gitgutter runs on `BufEnter` (defaults to yes)
- Whether or not vim-gitgutter runs for all buffers on `FocusGained` (defaults
Expand Down Expand Up @@ -155,6 +156,13 @@ To customise the symbols, add the following to your |vimrc|:
let g:gitgutter_sign_modified_removed = 'ww'
<

SIGNS

To never show signs, use this:
>
let git:gitgutter_signs = 0
<

LINE HIGHLIGHTS

Similarly to the signs' colours, set up the following highlight groups in your
Expand Down
7 changes: 5 additions & 2 deletions plugin/gitgutter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function! s:set(var, default)
endfunction

call s:set('g:gitgutter_enabled', 1)
call s:set('g:gitgutter_signs', 1)
call s:set('g:gitgutter_highlight_lines', 0)
let s:highlight_lines = g:gitgutter_highlight_lines
call s:set('g:gitgutter_sign_column_always', 0)
Expand Down Expand Up @@ -155,8 +156,10 @@ function! s:define_signs()
sign define GitGutterLineModifiedRemoved
sign define GitGutterDummy

call s:define_sign_symbols()
call s:define_sign_text_highlights()
if g:gitgutter_signs
call s:define_sign_symbols()
call s:define_sign_text_highlights()
endif
call s:define_sign_line_highlights()
endfunction

Expand Down

0 comments on commit 3243987

Please sign in to comment.