Skip to content

Commit

Permalink
Merge pull request #9 from L-P/feature/disable-load
Browse files Browse the repository at this point in the history
Add g:gitsessions_disable_auto_load option.
  • Loading branch information
wting committed Jul 2, 2015
2 parents 08752d9 + db71820 commit 654a569
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ Or

let g:gitsessions_dir = '/absolute/path/'


If you don't want the session to be loaded automatically when launching vim,
you can disable this behavior:

let g:gitsessions_disable_auto_load = 1

You need to set this variable _before_ loading the plugin.

### Misc

*plugin updates*
Expand Down
4 changes: 3 additions & 1 deletion plugin/gitsessions.vim
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,9 @@ endfunction

augroup gitsessions
autocmd!
autocmd VimEnter * :call g:GitSessionLoad()
if ! exists("g:gitsessions_disable_auto_load")
autocmd VimEnter * :call g:GitSessionLoad()
endif
autocmd BufEnter * :call g:GitSessionUpdate(0)
autocmd VimLeave * :call g:GitSessionUpdate()
augroup END
Expand Down

0 comments on commit 654a569

Please sign in to comment.