You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -113,7 +113,23 @@ The session.vim plug-in uses Vim's [:mksession] [mksession] command but it chang
113
113
If you want the plug-in to persist specific global variables or options you can add their names to the list `g:session_persist_globals` in your [vimrc script][vimrc]:
114
114
115
115
" Persist the value of the global option 'makeprg'.
116
-
call add(g:session_persist_globals, '&makeprg')
116
+
let g:session_persist_globals = ['&makeprg']
117
+
118
+
Because the [vimrc script][vimrc] is loaded before the plug-in you have to define the list yourself. To persist multiple values:
119
+
120
+
" Persist all options related to :make.
121
+
let g:session_persist_globals = ['&makeprg', '&makeef']
122
+
123
+
Here's how you persist global variables: (in this case the variables of the session plug-in itself :-)
124
+
125
+
" Persist the options of the session plug-in using the session plug-in...
126
+
let g:session_persist_globals = ['&sessionoptions']
The example above doesn't persist the `g:session_directory` variable because this variable is used before loading a session script so persisting it inside the session script is pointless.
0 commit comments