Skip to content

Commit ad6feb7

Browse files
committed
Define menu items for commands defined by plug-in (issue #41)
Issue #41 on GitHub: #41
1 parent 702d22c commit ad6feb7

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ When you start Vim with a custom [server name](http://vimdoc.sourceforge.net/htm
1818

1919
The session scripts created by this plug-in are stored in the directory `~/.vim/sessions` (on UNIX) or `~\vimfiles\sessions` (on Windows) but you can change the location by setting `g:session_directory`. If you're curious what the session scripts generated by `session.vim` look like see the [sample below](http://peterodding.com/code/vim/session/#sample_session_script).
2020

21+
If you're still getting to know the plug-in, the "Sessions" menu may help: It contains menu items for most commands defined by the plug-in.
22+
2123
## Installation
2224

2325
Unzip the most recent [ZIP archive](http://peterodding.com/code/vim/downloads/session.zip) file inside your Vim profile directory (usually this is `~/.vim` on UNIX and `%USERPROFILE%\vimfiles` on Windows), restart Vim and execute the command `:helptags ~/.vim/doc` (use `:helptags ~\vimfiles\doc` instead on Windows). After you restart Vim the following commands will be available to you:

autoload/xolox/session.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
" Vim script
22
" Author: Peter Odding
3-
" Last Change: May 6, 2013
3+
" Last Change: May 12, 2013
44
" URL: http://peterodding.com/code/vim/session/
55

6-
let g:xolox#session#version = '2.0'
6+
let g:xolox#session#version = '2.1'
77

88
call xolox#misc#compat#check('session', 2)
99

doc/session.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ change the location by setting |g:session_directory|. If you're curious what
8080
the session scripts generated by 'session.vim' look like see the sample below
8181
[3].
8282

83+
If you're still getting to know the plug-in, the "Sessions" menu may help: It
84+
contains menu items for most commands defined by the plug-in.
85+
8386
===============================================================================
8487
*session-installation*
8588
Installation ~

plugin/session.vim

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
" Vim script
22
" Author: Peter Odding
3-
" Last Change: May 6, 2013
3+
" Last Change: May 12, 2013
44
" URL: http://peterodding.com/code/vim/session/
55

66
" Support for automatic update using the GLVS plug-in.
@@ -95,6 +95,20 @@ if filewritable(s:directory) != 2
9595
endif
9696
unlet s:directory
9797

98+
" Define menu items to make the plug-in more accessible.
99+
amenu 400.10 &Sessions.&Open\ session\.\.\.<Tab>:OpenSession :OpenSession<CR>
100+
amenu 400.20 &Sessions.&Save\ session\.\.\.<Tab>:SaveSession :SaveSession<CR>
101+
amenu 400.30 &Sessions.&Close\ session\.\.\.<Tab>:CloseSession :CloseSession<CR>
102+
amenu 400.40 &Sessions.&Delete\ session\.\.\.<Tab>:DeleteSession :DeleteSession<CR>
103+
amenu 400.50 &Sessions.&View\ session\.\.\.<Tab>:ViewSession :ViewSession<CR>
104+
amenu 400.60 &Sessions.-Sep1- :
105+
amenu 400.70 &Sessions.Open\ tab\ session\.\.\.<Tab>:OpenTabSession :OpenTabSession<CR>
106+
amenu 400.80 &Sessions.&Append\ tab\ session\.\.\.<Tab>:AppendTabSession :AppendTabSession<CR>
107+
amenu 400.90 &Sessions.Save\ tab\ session\.\.\.<Tab>:SaveTabSession :SaveTabSession<CR>
108+
amenu 400.100 &Sessions.Close\ tab\ session\.\.\.<Tab>:CloseTabSession :CloseTabSession<CR>
109+
amenu 400.110 &Sessions.-Sep2- :
110+
amenu 400.120 &Sessions.&Restart\ Vim\.\.\.<Tab>:RestartVim :RestartVim<CR>
111+
98112
" Define automatic commands for automatic session management.
99113
augroup PluginSession
100114
autocmd!

0 commit comments

Comments
 (0)