Skip to content

Commit

Permalink
Change default behavior to always use gitsessions cache.
Browse files Browse the repository at this point in the history
  • Loading branch information
wting committed Aug 12, 2015
1 parent 3ddb608 commit d4e8c65
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,15 @@ You need to set this variable _before_ loading the plugin.

#### Toggle session caching behavior

If changing buffers is slow\*, the plugin can cache the sessions file so it's
not recalculated when switching between buffers:
By default the plugin caches the session file so it's not recalculated when
switching between buffers. However this means when switching between git
branches the user needs manually save to start saving against the new branch's
git session.

let g:gitsessions_use_cache = 1
To disable this behavior and always save vim sessions against the current git
branch name please add the following toggle to .vimrc:

let g:gitsessions_use_cache = 0

This does mean that the user has to actively purge the cache (by running
`GitSessionSave`) on all open vim programs using a repository if the underlying
Expand Down
2 changes: 1 addition & 1 deletion plugin/gitsessions.vim
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ endif
" You are advised to save it manually by calling to GitSessionSave()
" Default - cache disabled
if !exists('g:gitsessions_use_cache')
let g:gitsessions_use_cache = 0
let g:gitsessions_use_cache = 1
endif

" used to control auto-save behavior
Expand Down

0 comments on commit d4e8c65

Please sign in to comment.