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

Re: "New Document Here" service entry for MacVim

Expand Messages
  • Ted Pavlic
    I use On My Command to do exactly what you re talking about. If I right-click on any Folder (including my Desktop background), I can select New File in Vim
    Message 1 of 9 , Sep 9, 2008
    • 0 Attachment
      I use "On My Command" to do exactly what you're talking about. If I
      right-click on any Folder (including my Desktop background), I can
      select "New File in Vim" and I'm off and running.

      http://www.abracode.com/free/cmworkshop/on_my_command.html

      I setup a "New File in Vim" by using OMCEdit (which is a utility that
      comes with OnMyCommand) and added a "First Level" menu item which is
      active in the "Finder Window" that executes:

      /bin/bash --login -c "cd __OBJ_PATH__ && mvim"

      OnMyCommand substitutes the directory I'm clicking on in the place where
      __OBJ_PATH__ is.

      Similarly, I have an "Open File in Vim" that allows me to use Vim to
      edit ANY file, regardless of whether or not the Finder wants me to. Its
      command is:

      /bin/bash --login -c "cd __OBJ_PARENT_PATH__ && mvim __OBJ_NAME__"

      And its Activation Mode is set for "File or Folder (not Finder Window)."

      --Ted

      Ron Olson wrote:
      > Hi all-
      >
      > I discovered that there wasn't any obvious way to create a new text
      > document in the current open folder and discovered that the MacVim
      > services all presume you want to open an existing file. I was thinking
      > another entry that would be nice to have is one that opens Vim and
      > simply sets pwd to the current folder.
      >
      > I am game to add it myself but was wondering if either:
      >
      > 1. It's so drop-dead simple to create a new file using the Finder that
      > the functionality is redundant and I just haven't figured out how to
      > do it
      >
      > 2. Someone else is already working on it.
      >
      > If neither are the case, I'm willing to step forward to work on it.
      >
      >
      > Tacho
      >
      > >
      >

      --
      Ted Pavlic <ted@...>

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Ted Pavlic
      It looks like both Open File in Vim and New File in Vim are already accessible via the downloadable command library that OMCEdit uses. (note: I also have a
      Message 2 of 9 , Sep 9, 2008
      • 0 Attachment
        It looks like both "Open File in Vim" and "New File in Vim" are already
        accessible via the downloadable command library that OMCEdit uses.

        (note: I also have a "New File" that just touches a new file in the
        current directory; I can then rename that file and edit it in Vim. There
        are also plenty of "New..."-file modules for OMC that have file template
        support)

        --Ted

        Ted Pavlic wrote:
        > I use "On My Command" to do exactly what you're talking about. If I
        > right-click on any Folder (including my Desktop background), I can
        > select "New File in Vim" and I'm off and running.
        >
        > http://www.abracode.com/free/cmworkshop/on_my_command.html
        >
        > I setup a "New File in Vim" by using OMCEdit (which is a utility that
        > comes with OnMyCommand) and added a "First Level" menu item which is
        > active in the "Finder Window" that executes:
        >
        > /bin/bash --login -c "cd __OBJ_PATH__ && mvim"
        >
        > OnMyCommand substitutes the directory I'm clicking on in the place where
        > __OBJ_PATH__ is.
        >
        > Similarly, I have an "Open File in Vim" that allows me to use Vim to
        > edit ANY file, regardless of whether or not the Finder wants me to. Its
        > command is:
        >
        > /bin/bash --login -c "cd __OBJ_PARENT_PATH__ && mvim __OBJ_NAME__"
        >
        > And its Activation Mode is set for "File or Folder (not Finder Window)."
        >
        > --Ted
        >
        > Ron Olson wrote:
        >> Hi all-
        >>
        >> I discovered that there wasn't any obvious way to create a new text
        >> document in the current open folder and discovered that the MacVim
        >> services all presume you want to open an existing file. I was thinking
        >> another entry that would be nice to have is one that opens Vim and
        >> simply sets pwd to the current folder.
        >>
        >> I am game to add it myself but was wondering if either:
        >>
        >> 1. It's so drop-dead simple to create a new file using the Finder that
        >> the functionality is redundant and I just haven't figured out how to
        >> do it
        >>
        >> 2. Someone else is already working on it.
        >>
        >> If neither are the case, I'm willing to step forward to work on it.
        >>
        >>
        >> Tacho
        >>
        >

        --
        Ted Pavlic <ted@...>

        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • björn
        Ron, ... I d be interested to see what you can cook up. The current services were only added as an example of what can be done (I simply copied the ones that
        Message 3 of 9 , Sep 11, 2008
        • 0 Attachment
          Ron,

          2008/9/9 Ron Olson <tachoknight@...>:
          >
          > Ahh, I see what you mean. Yes, this does work, but it *is* an extra
          > step and I may not know what I want to call the file until the end.
          > That said, I think I will take a crack at adding this and see how it
          > comes out.

          I'd be interested to see what you can cook up. The current services
          were only added as an example of what can be done (I simply copied the
          ones that TextEdit have). I was hoping that somebody would look into
          this and actually come up with useful services some day...

          Björn

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