simplify auto session

Mon, 10 Jul 2017 19:23:03 -0400

author
Meredith Howard <mhoward@roomag.org>
date
Mon, 10 Jul 2017 19:23:03 -0400
changeset 619
b1cd1ee191be
parent 618
0305d79486fa
child 620
ce78d743489f

simplify auto session

.vim/autoload/vimrc.vim file | annotate | diff | comparison | revisions
.vimrc file | annotate | diff | comparison | revisions
--- a/.vim/autoload/vimrc.vim
+++ b/.vim/autoload/vimrc.vim
@@ -24,10 +24,7 @@ endfunc
 
 func! vimrc#AutoSessionConfig() abort
   if strlen(v:servername) > 0 && match(v:servername, 'VIM') == -1
-    let g:unite_source_session_default_session_name = tolower(v:servername)
-    let g:unite_source_session_enable_auto_save = 1
-
-    UniteSessionLoad
+    exec 'UniteSessionLoad ' . tolower(v:servername)
   endif
 endfunc
 
--- a/.vimrc
+++ b/.vimrc
@@ -362,6 +362,9 @@ try
 catch
 endtry
 
+" like autowrite, applies to any loaded session
+let g:unite_source_session_enable_auto_save = 1
+
 if executable('ag')
   let g:unite_source_grep_command = 'ag'
   let g:unite_source_grep_default_opts = '--nogroup --nocolor --column'

mercurial