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

Re: MacVim and LaTeX

Expand Messages
  • Ted Pavlic
    Running login scripts for *every* time Vim wants to shell out is overkill, and it may be a bad practice depending on what is run in a user s login scripts.
    Message 1 of 15 , Dec 29, 2007
    • 0 Attachment
      Running login scripts for *every* time Vim wants to shell out is
      overkill, and it may be a bad practice depending on what is run in a
      user's login scripts.

      Granted, running the login scripts *once* as Vim starts isn't ideal,
      especially if it's only to set the PATH. It seems like a better idea
      than running it at every shell.

      My fix (published in a previous message in this thread) *could* be
      integrated into MacVim's package directly (i.e., all it does is run
      MacVim after logging in). *HOWEVER*, this would mess up anyone who
      DEPENDS on environment.plist.

      This is the reason (I assumed) why gvim.app exists (rather than
      incorporating those changes directly into the Vim.app). Some people use
      environment.plist and others do not. The login scripts (unless written
      very specially) override the environment.plist PATH, and so forcing a
      login can mess those users up.

      --Ted

      Ben Schmidt wrote:
      > Ted Pavlic wrote:
      >>> As a workaround, and assuming your shell is bash, I suggest adding
      >>>
      >>> :set shell=/bin/bash\ -l
      >> That's a really bad idea.
      >
      > No it isn't. Why do you think so?
      >
      > Ben.
      >
      >
      >
      >
      > Send instant messages to your online friends http://au.messenger.yahoo.com
      >
      >
      > >
      >

      --
      Ted Pavlic <ted@...>

      --~--~---------~--~----~------------~-------~--~----~
      You received this message from the "vim_mac" maillist.
      For more information, visit http://www.vim.org/maillist.php
      -~----------~----~----~----~------~----~------~--~---
    • Vincent
      Thanks Ben and Tim! Both options work very nicely. Best, Vincent ... --~--~---------~--~----~------------~-------~--~----~ You received this message from the
      Message 2 of 15 , Dec 29, 2007
      • 0 Attachment
        Thanks Ben and Tim! Both options work very nicely.

        Best,

        Vincent

        On Dec 29, 3:17 pm, Ted Pavlic <t...@...> wrote:
        > Running login scripts for *every* time Vim wants to shell out is
        > overkill, and it may be a bad practice depending on what is run in a
        > user's login scripts.
        >
        > Granted, running the login scripts *once* as Vim starts isn't ideal,
        > especially if it's only to set the PATH. It seems like a better idea
        > than running it at every shell.
        >
        > My fix (published in a previous message in this thread) *could* be
        > integrated into MacVim's package directly (i.e., all it does is run
        > MacVim after logging in). *HOWEVER*, this would mess up anyone who
        > DEPENDS on environment.plist.
        >
        > This is the reason (I assumed) why gvim.app exists (rather than
        > incorporating those changes directly into the Vim.app). Some people use
        > environment.plist and others do not. The login scripts (unless written
        > very specially) override the environment.plist PATH, and so forcing a
        > login can mess those users up.
        >
        > --Ted
        >
        >
        >
        > Ben Schmidt wrote:
        > > Ted Pavlic wrote:
        > >>> As a workaround, and assuming your shell is bash, I suggest adding
        >
        > >>> :set shell=/bin/bash\ -l
        > >> That's a really bad idea.
        >
        > > No it isn't. Why do you think so?
        >
        > > Ben.
        >
        > > Send instant messages to your online friendshttp://au.messenger.yahoo.com
        >
        > --
        > Ted Pavlic <t...@...>
        --~--~---------~--~----~------------~-------~--~----~
        You received this message from the "vim_mac" maillist.
        For more information, visit http://www.vim.org/maillist.php
        -~----------~----~----~----~------~----~------~--~---
      • Ben Schmidt
        ... It s definitely a workaround, which is non-ideal by definition. But compared to what would most commonly be run in a call to the shell (e.g. make) it s
        Message 3 of 15 , Dec 29, 2007
        • 0 Attachment
          Ted Pavlic wrote:
          > Running login scripts for *every* time Vim wants to shell out is
          > overkill, and it may be a bad practice depending on what is run in a
          > user's login scripts.

          It's definitely a workaround, which is non-ideal by definition. But compared to
          what would most commonly be run in a call to the shell (e.g. make) it's next to
          negligible. Furthermore, if the user has dumb things in their login scripts,
          that's their fault, not the fault of the workaround.

          > Granted, running the login scripts *once* as Vim starts isn't ideal,
          > especially if it's only to set the PATH. It seems like a better idea
          > than running it at every shell.

          I agree. It's more complicated, though, than a single line in vimrc. I will have a
          look at your solution shortly, as it may yield (yet) another approach to the stuff
          I have been working on. At any rate, both approaches are non-ideal, but I see no
          reason to label either as "really bad."

          > My fix (published in a previous message in this thread) *could* be
          > integrated into MacVim's package directly (i.e., all it does is run
          > MacVim after logging in). *HOWEVER*, this would mess up anyone who
          > DEPENDS on environment.plist.
          >
          > This is the reason (I assumed) why gvim.app exists (rather than
          > incorporating those changes directly into the Vim.app). Some people use
          > environment.plist and others do not. The login scripts (unless written
          > very specially) override the environment.plist PATH, and so forcing a
          > login can mess those users up.

          What?! All two of them?! :-p

          In all seriousness, though, I do wonder how many people actually do make use of
          that, though. There can't be many. Particularly there can't be many who rely on
          stuff in environment.plist who expect it to be there when Vim calls a shell (or
          for access of environment variables within Vim). Most people would expect a call
          to shell in Vim to work like in Terminal.app, which logs in via login.

          It's a bit more complicated than all that though, because of the way MacVim spawns
          subprocesses, the need to support different shells, and so on.

          I think there are other deeper reasons for not starting MacVim via a wrapper that
          logs in first, though (interapplication communication and such).

          Ben.




          Send instant messages to your online friends http://au.messenger.yahoo.com


          --~--~---------~--~----~------------~-------~--~----~
          You received this message from the "vim_mac" maillist.
          For more information, visit http://www.vim.org/maillist.php
          -~----------~----~----~----~------~----~------~--~---
        • Ted Pavlic
          ... It s not really a wrapper as much as a launcher. All the script does is: if( something not defined ) define it exec $0 else exec macvim end Because
          Message 4 of 15 , Dec 29, 2007
          • 0 Attachment
            > It's a bit more complicated than all that though, because of the way
            > MacVim spawns subprocesses, the need to support different shells, and
            > so on.
            >
            > I think there are other deeper reasons for not starting MacVim via a
            > wrapper that logs in first, though (interapplication communication
            > and such).

            It's not really a wrapper as much as a launcher. All the script does is:

            if( something not defined )
            define it
            exec $0
            else
            exec macvim
            end

            Because everything gets exec'd, there are no extra processes hanging
            around, and macvim gets launched exactly as it would if it were called
            directly.

            Running mvim twice is identical to running MacVim twice, but the paths
            get set correctly.

            --Ted


            --
            Ted Pavlic <ted@...>

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