Skip to content

Commit

Permalink
Merge pull request #70: Allow to turn off Sessions menu
Browse files Browse the repository at this point in the history
See pull request #70 on GitHub:
  #70
  • Loading branch information
xolox committed Jul 20, 2013
2 parents 1f9bb68 + 58ae953 commit 9607a6b
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 17 deletions.
8 changes: 7 additions & 1 deletion README.md
Expand Up @@ -215,6 +215,12 @@ The aliases support tab completion just like the real commands; they're exactly

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].

### The `g:session_menu` option

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]:

:let g:session_menu = 0

### The `g:loaded_session` option

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

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

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

Expand Down
4 changes: 2 additions & 2 deletions autoload/xolox/session.vim
@@ -1,10 +1,10 @@
" Public API for the vim-session plug-in.
"
" Author: Peter Odding
" Last Change: July 5, 2013
" Last Change: July 20, 2013
" URL: http://peterodding.com/code/vim/session/

let g:xolox#session#version = '2.4.7'
let g:xolox#session#version = '2.4.8'

" Public API for session persistence. {{{1

Expand Down
13 changes: 11 additions & 2 deletions doc/session.txt
Expand Up @@ -31,7 +31,8 @@ Contents ~
11. The |g:session_persist_globals| option
12. The |g:session_restart_environment| option
13. The |g:session_command_aliases| option
14. The |g:loaded_session| option
14. The |g:session_menu| option
15. The |g:loaded_session| option
5. Compatibility with other plug-ins |session-compatibility-with-other-plug-ins|
6. Known issues |session-known-issues|
7. Function reference |session-function-reference|
Expand Down Expand Up @@ -439,6 +440,14 @@ the same except for the names.
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|.

-------------------------------------------------------------------------------
The *g:session_menu* option

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:
>
:let g:session_menu = 0
<
-------------------------------------------------------------------------------
The *g:loaded_session* option

Expand Down Expand Up @@ -481,7 +490,7 @@ might take a while...)
Function reference ~

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

-------------------------------------------------------------------------------
*public-api-for-vim-session-plug-in*
Expand Down
31 changes: 19 additions & 12 deletions plugin/session.vim
Expand Up @@ -104,6 +104,11 @@ if !exists('g:session_command_aliases')
let g:session_command_aliases = 0
endif

" Allow to turn off the menu.
if !exists('g:session_menu')
let g:session_menu = 1
endif

" Make sure the sessions directory exists and is writable. {{{1

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

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

amenu 400.10 &Sessions.&Open\ session\.\.\.<Tab>:OpenSession :OpenSession<CR>
amenu 400.20 &Sessions.&Save\ session\.\.\.<Tab>:SaveSession :SaveSession<CR>
amenu 400.30 &Sessions.&Close\ session\.\.\.<Tab>:CloseSession :CloseSession<CR>
amenu 400.40 &Sessions.&Delete\ session\.\.\.<Tab>:DeleteSession :DeleteSession<CR>
amenu 400.50 &Sessions.&View\ session\.\.\.<Tab>:ViewSession :ViewSession<CR>
amenu 400.60 &Sessions.-Sep1- :
amenu 400.70 &Sessions.Open\ tab\ session\.\.\.<Tab>:OpenTabSession :OpenTabSession<CR>
amenu 400.80 &Sessions.&Append\ tab\ session\.\.\.<Tab>:AppendTabSession :AppendTabSession<CR>
amenu 400.90 &Sessions.Save\ tab\ session\.\.\.<Tab>:SaveTabSession :SaveTabSession<CR>
amenu 400.100 &Sessions.Close\ tab\ session\.\.\.<Tab>:CloseTabSession :CloseTabSession<CR>
amenu 400.110 &Sessions.-Sep2- :
amenu 400.120 &Sessions.&Restart\ Vim\.\.\.<Tab>:RestartVim :RestartVim<CR>
if g:session_menu
amenu 400.10 &Sessions.&Open\ session\.\.\.<Tab>:OpenSession :OpenSession<CR>
amenu 400.20 &Sessions.&Save\ session\.\.\.<Tab>:SaveSession :SaveSession<CR>
amenu 400.30 &Sessions.&Close\ session\.\.\.<Tab>:CloseSession :CloseSession<CR>
amenu 400.40 &Sessions.&Delete\ session\.\.\.<Tab>:DeleteSession :DeleteSession<CR>
amenu 400.50 &Sessions.&View\ session\.\.\.<Tab>:ViewSession :ViewSession<CR>
amenu 400.60 &Sessions.-Sep1- :
amenu 400.70 &Sessions.Open\ tab\ session\.\.\.<Tab>:OpenTabSession :OpenTabSession<CR>
amenu 400.80 &Sessions.&Append\ tab\ session\.\.\.<Tab>:AppendTabSession :AppendTabSession<CR>
amenu 400.90 &Sessions.Save\ tab\ session\.\.\.<Tab>:SaveTabSession :SaveTabSession<CR>
amenu 400.100 &Sessions.Close\ tab\ session\.\.\.<Tab>:CloseTabSession :CloseTabSession<CR>
amenu 400.110 &Sessions.-Sep2- :
amenu 400.120 &Sessions.&Restart\ Vim\.\.\.<Tab>:RestartVim :RestartVim<CR>
endif

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

Expand Down

0 comments on commit 9607a6b

Please sign in to comment.