On 22/01/11 9:31 AM, Anton Egorov wrote:
I want to have desktop shoptcuts for opening mvim for different
projects, The idea is to click on the desktop icon to open mvim with
options like cd or session. Can you help me?

I do this kind of thing by having this in my ~/.gvimrc

an 10.360 File.Save\ Session\ As\.\.\.<Tab>:mksession :browse confirm 
mksession<CR>

and the attached script in my ~/.vim/plugin

Then I can use the menu item (or just :mksession at the Vim commandline) to create a session file, and to easily use it, I just double click it, and then type Y.

Ben.


" Vim plugin for automatically sourcing sessions
" Maintainer: Ben Schmidt <mail_ben_schm...@yahoo.com.au>
" Last Change: 2008 Nov 15

" Exit quickly when:
" - this plugin was already loaded
" - when 'compatible' is set
if exists("loaded_sessionsource") || &cp
  finish
endif
let loaded_sessionsource = 1

augroup sessionsource
  au!
  au FileType vim call s:SessionSource()
augroup END

func! s:SessionSource()
  if getline('.') == "let SessionLoad = 1"
    if exists('b:SessionSourcePrompted') | return | endif
    let b:SessionSourcePrompted = 1
    if confirm(expand('%')." looks like a Vim session. Source it?",
          \ "&Yes\n&No") == 1
      source %
    endif
  endif
endfunc

-- 
You received this message from the "vim_mac" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to