diff --git a/plugin/gitgutter.vim b/plugin/gitgutter.vim index 213990e..e4f607a 100644 --- a/plugin/gitgutter.vim +++ b/plugin/gitgutter.vim @@ -245,6 +245,14 @@ function! EnableGitGutter() call GitGutter() endfunction +function! ToggleGitGutter() + if s:is_gitgutter_enabled() + call DisableGitGutter() + else + call EnableGitGutter() + endif +endfunction + augroup gitgutter autocmd! autocmd BufReadPost,BufWritePost,FileReadPost,FileWritePost * call GitGutter()