Skip to content

Commit

Permalink
Define menu items for commands defined by plug-in (issue #41)
Browse files Browse the repository at this point in the history
Issue #41 on GitHub:
  #41
  • Loading branch information
xolox committed May 12, 2013
1 parent 702d22c commit ad6feb7
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
2 changes: 2 additions & 0 deletions README.md
Expand Up @@ -18,6 +18,8 @@ When you start Vim with a custom [server name](http://vimdoc.sourceforge.net/htm

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

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.

## Installation

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:
Expand Down
4 changes: 2 additions & 2 deletions autoload/xolox/session.vim
@@ -1,9 +1,9 @@
" Vim script
" Author: Peter Odding
" Last Change: May 6, 2013
" Last Change: May 12, 2013
" URL: http://peterodding.com/code/vim/session/

let g:xolox#session#version = '2.0'
let g:xolox#session#version = '2.1'

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

Expand Down
3 changes: 3 additions & 0 deletions doc/session.txt
Expand Up @@ -80,6 +80,9 @@ 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
[3].

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.

===============================================================================
*session-installation*
Installation ~
Expand Down
16 changes: 15 additions & 1 deletion plugin/session.vim
@@ -1,6 +1,6 @@
" Vim script
" Author: Peter Odding
" Last Change: May 6, 2013
" Last Change: May 12, 2013
" URL: http://peterodding.com/code/vim/session/

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

" Define menu items to make the plug-in more accessible.
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>

" Define automatic commands for automatic session management.
augroup PluginSession
autocmd!
Expand Down

0 comments on commit ad6feb7

Please sign in to comment.