|
1 | 1 | " Vim script |
2 | 2 | " Author: Peter Odding |
3 | | -" Last Change: November 11, 2011 |
| 3 | +" Last Change: December 11, 2011 |
4 | 4 | " URL: http://peterodding.com/code/vim/session/ |
5 | 5 |
|
6 | 6 | " Support for automatic update using the GLVS plug-in. |
@@ -54,6 +54,12 @@ if !exists('g:session_directory') |
54 | 54 | endif |
55 | 55 | endif |
56 | 56 |
|
| 57 | +" Define session command aliases of the form "Session" + Action in addition |
| 58 | +" to the real command names which are of the form Action + "Session"? |
| 59 | +if !exists('g:session_command_aliases') |
| 60 | + let g:session_command_aliases = 0 |
| 61 | +endif |
| 62 | + |
57 | 63 | " Make sure the session scripts directory exists and is writable. |
58 | 64 | let s:directory = fnamemodify(g:session_directory, ':p') |
59 | 65 | if !isdirectory(s:directory) |
@@ -84,6 +90,16 @@ command! -bar -bang -nargs=? -complete=customlist,xolox#session#complete_names D |
84 | 90 | command! -bar -bang CloseSession call xolox#session#close_cmd(<q-bang>, 0) |
85 | 91 | command! -bang -nargs=* -complete=command RestartVim call xolox#session#restart_cmd(<q-bang>, <q-args>) |
86 | 92 |
|
| 93 | +if g:session_command_aliases |
| 94 | + " Define command aliases of the form "Session" + Action in addition to |
| 95 | + " the real command names which are of the form Action + "Session" (above). |
| 96 | + command! -bar -bang -nargs=? -complete=customlist,xolox#session#complete_names SessionOpen call xolox#session#open_cmd(<q-args>, <q-bang>) |
| 97 | + command! -bar -nargs=? -complete=customlist,xolox#session#complete_names SessionView call xolox#session#view_cmd(<q-args>) |
| 98 | + command! -bar -bang -nargs=? -complete=customlist,xolox#session#complete_names SessionSave call xolox#session#save_cmd(<q-args>, <q-bang>) |
| 99 | + command! -bar -bang -nargs=? -complete=customlist,xolox#session#complete_names SessionDelete call xolox#session#delete_cmd(<q-args>, <q-bang>) |
| 100 | + command! -bar -bang SessionClose call xolox#session#close_cmd(<q-bang>, 0) |
| 101 | +endif |
| 102 | + |
87 | 103 | " Don't reload the plug-in once it has loaded successfully. |
88 | 104 | let g:loaded_session = 1 |
89 | 105 |
|
|
0 commit comments