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
+27-3Lines changed: 27 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -227,6 +227,10 @@ By default the plug-in installs a top level menu. If you don't like this you can
227
227
228
228
:let g:session_menu = 0
229
229
230
+
### The `g:session_name_suggestion_function` option
231
+
232
+
The default completion of the `:SaveSession` command is based on the names of the existing sessions. You can add your own suggestions using this option by setting the option to the name of a Vim script function. By default this option is set to an example function that suggests the name of the current git or Mercurial feature branch (when you're working in a version control repository).
233
+
230
234
### The `g:loaded_session` option
231
235
232
236
This variable isn't really an option but if you want to avoid loading the vim-session plug-in you can set this variable to any value in your [vimrc script][vimrc]:
@@ -251,8 +255,8 @@ Recently this plug-in switched from reimplementing [:mksession][mksession] to ac
251
255
252
256
<!-- Start of generated documentation -->
253
257
254
-
The documentation of the 34 functions below was extracted from
255
-
1 Vim scripts on July 6, 2014 at 21:01.
258
+
The documentation of the 37 functions below was extracted from
259
+
2 Vim scripts on July 6, 2014 at 22:23.
256
260
257
261
### Public API for the vim-session plug-in
258
262
@@ -405,10 +409,20 @@ configured with `g:session_directory` for files that end with the suffix
405
409
configured with `g:session_extension`, takes the base name of each file
406
410
and decodes any URL encoded characters. Returns a list of strings.
407
411
412
+
If the first argument is true (1) then the user defined function
413
+
configured with `g:session_name_suggestion_function` is called to find
414
+
suggested session names, which are prefixed to the list of available
415
+
sessions, otherwise the argument should be false (0).
416
+
408
417
#### The `xolox#session#complete_names()` function
409
418
410
419
Completion function for user defined Vim commands. Used by commands like
411
-
`:OpenSession` and `:DeleteSession` to support user friendly completion.
420
+
`:OpenSession` and `:DeleteSession` (but not `:SaveSession`) to support
421
+
user friendly completion.
422
+
423
+
#### The `xolox#session#complete_names_with_suggestions()` function
424
+
425
+
Completion function for the Vim command `:SaveSession`.
412
426
413
427
#### The `xolox#session#is_tab_scoped()` function
414
428
@@ -449,6 +463,16 @@ scoped session. Saves a copy of the original value to be restored later.
449
463
450
464
Restore the original value of Vim's [sessionoptions][] option.
451
465
466
+
### Example function for session name suggestions
467
+
468
+
#### The `xolox#session#suggestions#vcs_feature_branch()` function
469
+
470
+
This function implements an example of a function that can be used with
471
+
the `g:session_name_suggestion_function` option. It finds the name of the
472
+
current git or Mercurial feature branch (if any) and suggests this name as
473
+
the name for the session that is being saved with :SaveSession. Returns a
474
+
list with one string on success and an empty list on failure.
0 commit comments