Loading ...
Sorry, an error occurred while loading the content.

Open MacVim with some options

Expand Messages
  • Anton Egorov
    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
    Message 1 of 3 , Jan 21, 2011
    • 0 Attachment
      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?

      --
      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
    • Ben Schmidt
      ... I do this kind of thing by having this in my ~/.gvimrc an 10.360 File.Save Session As . . . :mksession :browse confirm mksession and the attached
      Message 2 of 3 , Jan 22, 2011
      • 0 Attachment
        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.
      • Anton Egorov
        Thanks for suggestion, Ben! I will try the idea with sessions. ... -- You received this message from the vim_mac maillist. Do not top-post! Type your reply
        Message 3 of 3 , Jan 22, 2011
        • 0 Attachment
          Thanks for suggestion, Ben! I will try the idea with sessions.

          On 22 January 2011 13:00, Ben Schmidt <mail_ben_schmidt@...> wrote:
          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_schmidt@...>
          " 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


          --
          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
        Your message has been successfully submitted and would be delivered to recipients shortly.