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

Re: Automatically edit file on startup without confirm dialogue?

Expand Messages
  • Marshall Abrams
    Thanks much to John, Ben, Nico, The silent prefix was perfect--what I was looking for. It solved the problem for my inelegant, quick-and-dirty hack. I can
    Message 1 of 5 , Aug 25, 2008
    • 0 Attachment
      Thanks much to John, Ben, Nico,

      The 'silent' prefix was perfect--what I was looking for.  It solved the problem for my inelegant, quick-and-dirty hack.  I can switch to your suggested proper solutions later.  (Witch sounds worth getting regardless.)
      Amazing someone is still using Carbon Vim! 
      (Of course they are!  For me, getting work done with a nonbroken, great tool takes precedence over getting the latest version--and probably having to recustomize it to work the way I want.)

      Thanks!

      Marshall

      On Aug 23, 2008, at 2:15 AM, Nico Weber wrote:


      Hi,

      On 23.08.2008, at 03:58, John Velman wrote:

      I'm kind of a novice at mac, but I think this would be easy with
      applescript.

      Yes. Open Script Editor and put

           tell application "MacVim" to open "/Users/nico/src/snippets/ 
      todo.txt"

      into it. Save that as an application, and put it into your dock.  
      Change the icon if you want. That's all you need to do (well, and  
      adapt the path of the file) :-)

      HTH,
      Nico


      Subject: Re: Automatically edit file on startup without confirm dialogue?
      Date: August 23, 2008 12:06:59 AM CDT
      To:   vim_mac@...
      Reply-To:   vim_mac@...



      Now I want to make my special second copy of vim (the one described  
      above) automatically load my todo list whenever I start this  
      application.  I tried sticking variations on "edit $HOME/todo" at the  
      end of the vimrc or gvimrc in the application tree (/Application/ 
      VimTodo.app/Contents/Resources/vim).  This works, but also produces  
      an annoying "OK" dialogue listing the name of the file opened (twice)  
      and the number of lines and characters in it.

      My question:

      Anybody know how to prevent the useless dialogue from showing up?


      I suppose

      :silent edit todo.txt

      should do it. If it doesn't

      :silent! edit todo.txt

      almost certainly will.

      Amazing someone is still using Carbon Vim! (I suppose this is what
      you're using.) Most people seem to now be using MacVim


      and a few Vim-cocoa


      I'd recommend MacVim. It does what most Mac apps do and only has a
      single Dock icon for a number of windows (Vims). You'd have to solve
      your to do list dock icon problem a different way, though. AppleScript
      is one way. I find using Witch is good enough for me to easily find and
      get to my to do list which is also in Vim


      But you may find it's less trouble finding/getting to it with MacVim
      anyway.

      Smiles,

      Ben.


      I'm kind of a novice at mac, but I think this would be easy with
      applescript.  I had started something similar (bring up mutt in a specially
      colored terminal on login), but got sidetracked learning Cocoa.  Lots more
      fun than Applescript.  But I think what you want to do should be relatively
      easy.

      Best,

      John V.


      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---

    Your message has been successfully submitted and would be delivered to recipients shortly.