Skip to content

Commit 9607a6b

Browse files
committed
Merge pull request #70: Allow to turn off Sessions menu
See pull request #70 on GitHub: #70
2 parents 1f9bb68 + 58ae953 commit 9607a6b

File tree

4 files changed

+39
-17
lines changed

4 files changed

+39
-17
lines changed

README.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,12 @@ The aliases support tab completion just like the real commands; they're exactly
215215

216216
When you enable the aliases, the default command names will still be available. If you really don't like them, feel free to delete them using [:delcommand] [delcommand].
217217

218+
### The `g:session_menu` option
219+
220+
By default the plug-in installs a top level menu. If you don't like this you can disable it by adding the following line to your [vimrc script] [vimrc]:
221+
222+
:let g:session_menu = 0
223+
218224
### The `g:loaded_session` option
219225

220226
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]:
@@ -240,7 +246,7 @@ Recently this plug-in switched from reimplementing [:mksession][mksession] to ac
240246
<!-- Start of generated documentation -->
241247

242248
The documentation of the 34 functions below was extracted from
243-
1 Vim scripts on July 5, 2013 at 00:31.
249+
1 Vim scripts on July 20, 2013 at 12:48.
244250

245251
### Public API for the vim-session plug-in
246252

autoload/xolox/session.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
" Public API for the vim-session plug-in.
22
"
33
" Author: Peter Odding
4-
" Last Change: July 5, 2013
4+
" Last Change: July 20, 2013
55
" URL: http://peterodding.com/code/vim/session/
66

7-
let g:xolox#session#version = '2.4.7'
7+
let g:xolox#session#version = '2.4.8'
88

99
" Public API for session persistence. {{{1
1010

doc/session.txt

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@ Contents ~
3131
11. The |g:session_persist_globals| option
3232
12. The |g:session_restart_environment| option
3333
13. The |g:session_command_aliases| option
34-
14. The |g:loaded_session| option
34+
14. The |g:session_menu| option
35+
15. The |g:loaded_session| option
3536
5. Compatibility with other plug-ins |session-compatibility-with-other-plug-ins|
3637
6. Known issues |session-known-issues|
3738
7. Function reference |session-function-reference|
@@ -439,6 +440,14 @@ the same except for the names.
439440
When you enable the aliases, the default command names will still be available.
440441
If you really don't like them, feel free to delete them using |:delcommand|.
441442

443+
-------------------------------------------------------------------------------
444+
The *g:session_menu* option
445+
446+
By default the plug-in installs a top level menu. If you don't like this you
447+
can disable it by adding the following line to your |vimrc| script:
448+
>
449+
:let g:session_menu = 0
450+
<
442451
-------------------------------------------------------------------------------
443452
The *g:loaded_session* option
444453

@@ -481,7 +490,7 @@ might take a while...)
481490
Function reference ~
482491

483492
The documentation of the 34 functions below was extracted from 1 Vim scripts on
484-
July 5, 2013 at 00:31.
493+
July 20, 2013 at 12:48.
485494

486495
-------------------------------------------------------------------------------
487496
*public-api-for-vim-session-plug-in*

plugin/session.vim

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ if !exists('g:session_command_aliases')
104104
let g:session_command_aliases = 0
105105
endif
106106

107+
" Allow to turn off the menu.
108+
if !exists('g:session_menu')
109+
let g:session_menu = 1
110+
endif
111+
107112
" Make sure the sessions directory exists and is writable. {{{1
108113

109114
let s:directory = fnamemodify(g:session_directory, ':p')
@@ -120,18 +125,20 @@ unlet s:directory
120125

121126
" Menu items to make the plug-in more accessible. {{{1
122127

123-
amenu 400.10 &Sessions.&Open\ session\.\.\.<Tab>:OpenSession :OpenSession<CR>
124-
amenu 400.20 &Sessions.&Save\ session\.\.\.<Tab>:SaveSession :SaveSession<CR>
125-
amenu 400.30 &Sessions.&Close\ session\.\.\.<Tab>:CloseSession :CloseSession<CR>
126-
amenu 400.40 &Sessions.&Delete\ session\.\.\.<Tab>:DeleteSession :DeleteSession<CR>
127-
amenu 400.50 &Sessions.&View\ session\.\.\.<Tab>:ViewSession :ViewSession<CR>
128-
amenu 400.60 &Sessions.-Sep1- :
129-
amenu 400.70 &Sessions.Open\ tab\ session\.\.\.<Tab>:OpenTabSession :OpenTabSession<CR>
130-
amenu 400.80 &Sessions.&Append\ tab\ session\.\.\.<Tab>:AppendTabSession :AppendTabSession<CR>
131-
amenu 400.90 &Sessions.Save\ tab\ session\.\.\.<Tab>:SaveTabSession :SaveTabSession<CR>
132-
amenu 400.100 &Sessions.Close\ tab\ session\.\.\.<Tab>:CloseTabSession :CloseTabSession<CR>
133-
amenu 400.110 &Sessions.-Sep2- :
134-
amenu 400.120 &Sessions.&Restart\ Vim\.\.\.<Tab>:RestartVim :RestartVim<CR>
128+
if g:session_menu
129+
amenu 400.10 &Sessions.&Open\ session\.\.\.<Tab>:OpenSession :OpenSession<CR>
130+
amenu 400.20 &Sessions.&Save\ session\.\.\.<Tab>:SaveSession :SaveSession<CR>
131+
amenu 400.30 &Sessions.&Close\ session\.\.\.<Tab>:CloseSession :CloseSession<CR>
132+
amenu 400.40 &Sessions.&Delete\ session\.\.\.<Tab>:DeleteSession :DeleteSession<CR>
133+
amenu 400.50 &Sessions.&View\ session\.\.\.<Tab>:ViewSession :ViewSession<CR>
134+
amenu 400.60 &Sessions.-Sep1- :
135+
amenu 400.70 &Sessions.Open\ tab\ session\.\.\.<Tab>:OpenTabSession :OpenTabSession<CR>
136+
amenu 400.80 &Sessions.&Append\ tab\ session\.\.\.<Tab>:AppendTabSession :AppendTabSession<CR>
137+
amenu 400.90 &Sessions.Save\ tab\ session\.\.\.<Tab>:SaveTabSession :SaveTabSession<CR>
138+
amenu 400.100 &Sessions.Close\ tab\ session\.\.\.<Tab>:CloseTabSession :CloseTabSession<CR>
139+
amenu 400.110 &Sessions.-Sep2- :
140+
amenu 400.120 &Sessions.&Restart\ Vim\.\.\.<Tab>:RestartVim :RestartVim<CR>
141+
endif
135142

136143
" Automatic commands for automatic session management. {{{1
137144

0 commit comments

Comments
 (0)