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

"Silent" loading of plugins.

Expand Messages
  • Christian Dysthe
    Hi, is it possible to have Vim load plug-ins without any output to the terminal? -- //Christian Registered Linux User #228949 at: http://counter.li.org/ --
    Message 1 of 11 , Jun 27, 2003
    • 0 Attachment
      Hi,

      is it possible to have Vim load plug-ins without any output to the
      terminal?

      --
      //Christian
      Registered Linux User #228949 at: http://counter.li.org/

      -- What if it all means something? --
    • Benji Fisher
      ... I am not sure what output you mean. Are you talking about start-up, or after you have started editing? HTH --Benji Fisher
      Message 2 of 11 , Jun 27, 2003
      • 0 Attachment
        Christian Dysthe wrote:
        > Hi,
        >
        > is it possible to have Vim load plug-ins without any output to the
        > terminal?

        I am not sure what output you mean. Are you talking about start-up, or
        after you have started editing?

        HTH --Benji Fisher
      • Christian Dysthe
        ... I looked into this some more and found that the spell checker itself sends all this output to the terminal. I removed all the echo stuff in the script and
        Message 3 of 11 , Jun 30, 2003
        • 0 Attachment
          On Fri, 27 Jun 2003, Benji Fisher wrote:

          > Christian Dysthe wrote:
          > >Hi,
          > >
          > >is it possible to have Vim load plug-ins without any output to the
          > >terminal?
          >
          > I am not sure what output you mean. Are you talking about start-up,
          > or after you have started editing?

          I looked into this some more and found that the spell checker itself
          sends all this output to the terminal. I removed all the echo stuff in
          the script and now it loads without without output. However, what I
          was wondering was if there's a way to load vim plug-in scripts without
          any output. A lot of applications and scripts I use have this option
          like for instance 'make' that has the --silent and --quiet switches. I
          thought something similar might be available in vim?
          >
          > HTH --Benji Fisher
          >
          >


          --
          //Christian
          Registered Linux User #228949 at: http://counter.li.org/

          -- What if it all means something? --
        • Benji Fisher
          ... I think that ... should work. You are still not giving many details about how you load your vim scripts. ... HTH --Benji Fisher
          Message 4 of 11 , Jul 1, 2003
          • 0 Attachment
            Christian Dysthe wrote:
            > On Fri, 27 Jun 2003, Benji Fisher wrote:
            >
            >
            >>Christian Dysthe wrote:
            >>
            >>>Hi,
            >>>
            >>>is it possible to have Vim load plug-ins without any output to the
            >>>terminal?
            >>
            >> I am not sure what output you mean. Are you talking about start-up,
            >> or after you have started editing?
            >
            >
            > I looked into this some more and found that the spell checker itself
            > sends all this output to the terminal. I removed all the echo stuff in
            > the script and now it loads without without output. However, what I
            > was wondering was if there's a way to load vim plug-in scripts without
            > any output. A lot of applications and scripts I use have this option
            > like for instance 'make' that has the --silent and --quiet switches. I
            > thought something similar might be available in vim?

            I think that

            :silent source script.vim

            should work. You are still not giving many details about how you load your vim
            scripts.

            :help :silent
            :help :source

            HTH --Benji Fisher
          • Antoine J. Mechelynck
            ... That may be all right for files you source explicitly. But what about global plugins (which are sourced automatically at the end of startup) and filetype
            Message 5 of 11 , Jul 1, 2003
            • 0 Attachment
              Benji Fisher <benji@...> wrote:
              > Christian Dysthe wrote:
              > > On Fri, 27 Jun 2003, Benji Fisher wrote:
              > >
              > >
              > > > Christian Dysthe wrote:
              > > >
              > > > > Hi,
              > > > >
              > > > > is it possible to have Vim load plug-ins without any output to
              > > > > the terminal?
              > > >
              > > > I am not sure what output you mean. Are you talking about
              > > > start-up, or after you have started editing?
              > >
              > >
              > > I looked into this some more and found that the spell checker itself
              > > sends all this output to the terminal. I removed all the echo stuff
              > > in
              > > the script and now it loads without without output. However, what I
              > > was wondering was if there's a way to load vim plug-in scripts
              > > without
              > > any output. A lot of applications and scripts I use have this option
              > > like for instance 'make' that has the --silent and --quiet
              > > switches. I thought something similar might be available in vim?
              >
              > I think that
              >
              > > silent source script.vim
              >
              > should work. You are still not giving many details about how you
              > load your vim scripts.
              >
              > > help :silent
              > > help :source
              >
              > HTH --Benji Fisher

              That may be all right for files you source explicitly. But what about global
              plugins (which are sourced automatically at the end of startup) and filetype
              plugins (which are sourced automatically if enabled, when the filetype is
              set IIUC)?

              Regards,
              Tony.
            • Christian Dysthe
              ... i should work. You are still not giving many details about how you load your ... I want this spell checker plug-in to load when I edit mail in mutt where
              Message 6 of 11 , Jul 1, 2003
              • 0 Attachment
                On Tue, 01 Jul 2003, Benji Fisher wrote:
                >
                > I think that
                >
                > :silent source script.vim
                >
                i> should work. You are still not giving many details about how you load your
                > vim scripts.

                I want this spell checker plug-in to load when I edit mail in mutt
                where vim is set as editor. I have this in my .vimrc:

                autocmd BufRead $HOME/.temp/mutt* so ~/.vim/plugin/engspchk.vim

                Since this is a spell checker I want it to load and do it's thing
                every time my email client (mutt) opens vim for email editing without
                sending anything to the terminal. Since I am opening vim from mutt in
                this case the terminal output from the script is annoying and not
                something I want to see every time I write or reply to email. Again,
                removing all the output stuff from the script did the trick, but I
                would like to know if it's possible to load plug-ins without a hack
                like the one I did by removing all of the scripts output.
                >
                > :help :silent :help :source
                >
                > HTH --Benji Fisher
                >


                --
                //Christian
                Registered Linux User #228949 at: http://counter.li.org/

                -- What if it all means something? --
              • Gary Johnson
                ... So, did adding silent to your autocommand like this work or not? autocmd BufRead $HOME/.temp/mutt* silent so ~/.vim/plugin/engspchk.vim This should also
                Message 7 of 11 , Jul 1, 2003
                • 0 Attachment
                  On 2003-07-01, Christian Dysthe <christian@...> wrote:
                  > On Tue, 01 Jul 2003, Benji Fisher wrote:
                  > >
                  > > I think that
                  > >
                  > > :silent source script.vim
                  > >
                  > i> should work. You are still not giving many details about how you load your
                  > > vim scripts.
                  >
                  > I want this spell checker plug-in to load when I edit mail in mutt
                  > where vim is set as editor. I have this in my .vimrc:
                  >
                  > autocmd BufRead $HOME/.temp/mutt* so ~/.vim/plugin/engspchk.vim
                  >
                  > Since this is a spell checker I want it to load and do it's thing
                  > every time my email client (mutt) opens vim for email editing without
                  > sending anything to the terminal. Since I am opening vim from mutt in
                  > this case the terminal output from the script is annoying and not
                  > something I want to see every time I write or reply to email. Again,
                  > removing all the output stuff from the script did the trick, but I
                  > would like to know if it's possible to load plug-ins without a hack
                  > like the one I did by removing all of the scripts output.
                  > >
                  > > :help :silent :help :source

                  So, did adding 'silent' to your autocommand like this work or not?

                  autocmd BufRead $HOME/.temp/mutt* silent so ~/.vim/plugin/engspchk.vim

                  This should also work:

                  autocmd BufRead $HOME/.temp/mutt* silent normal \ec

                  since, being in your plugin directory, engspchk.vim should already
                  be loaded automatically.

                  Gary

                  --
                  Gary Johnson | Agilent Technologies
                  garyjohn@... | Wireless Division
                  | Spokane, Washington, USA
                • Christian Dysthe
                  ... Yes it did. I had to get the original plugin to check since I modified it. ... Sure did! :) ... It s in my home plugin dir but it doesn t load unless I put
                  Message 8 of 11 , Jul 2, 2003
                  • 0 Attachment
                    On Tue, 01 Jul 2003, Gary Johnson wrote:
                    >
                    > So, did adding 'silent' to your autocommand like this work or not?
                    >
                    > autocmd BufRead $HOME/.temp/mutt* silent so ~/.vim/plugin/engspchk.vim

                    Yes it did. I had to get the original plugin to check since I modified
                    it.
                    >
                    > This should also work:
                    >
                    > autocmd BufRead $HOME/.temp/mutt* silent normal \ec

                    Sure did! :)
                    >
                    > since, being in your plugin directory, engspchk.vim should already
                    > be loaded automatically.

                    It's in my home plugin dir but it doesn't load unless I put it in the
                    system plugin directory: /usr/share/vim/plugin However, if I put it
                    there how do I make sure it loads silently?

                    Thank you for your patience with me. I'm new to vim.. :)
                    >
                    > Gary
                    >
                    > --
                    > Gary Johnson | Agilent Technologies
                    > garyjohn@... | Wireless Division
                    > | Spokane, Washington, USA
                    >


                    --
                    //Christian
                    Registered Linux User #228949 at: http://counter.li.org/

                    -- What if it all means something? --
                  • Gary Johnson
                    ... shows the list of places from which vim loads plugins. Unless there is something wrong with your setup, engspchk.vim should load automatically just as
                    Message 9 of 11 , Jul 2, 2003
                    • 0 Attachment
                      On 2003-07-02, Christian Dysthe <christian@...> wrote:
                      > On Tue, 01 Jul 2003, Gary Johnson wrote:

                      > > This should also work:
                      > >
                      > > autocmd BufRead $HOME/.temp/mutt* silent normal \ec
                      >
                      > Sure did! :)
                      > >
                      > > since, being in your plugin directory, engspchk.vim should already
                      > > be loaded automatically.
                      >
                      > It's in my home plugin dir but it doesn't load unless I put it in the
                      > system plugin directory: /usr/share/vim/plugin However, if I put it
                      > there how do I make sure it loads silently?

                      :help runtimepath

                      shows the list of places from which vim loads plugins. Unless there
                      is something wrong with your setup, engspchk.vim should load
                      automatically just as well from ~/.vim/plugin/engspchk.vim as from
                      /usr/share/vim/plugin. Note, however, that the plugin does not
                      print all those messages the first time it loads--it prints them
                      only on subsequent loads or when \ec is executed, at least in my
                      experimentation.

                      So, do you have engspchk.vim in _only_ /usr/share/vim/plugin or do
                      you have it in both ~/.vim/plugin _and_ /usr/share/vim/plugin? If
                      you have it in both places, it will be loaded automatically twice
                      and will print those messages the second time it is loaded.

                      Gary

                      --
                      Gary Johnson | Agilent Technologies
                      garyjohn@... | Wireless Division
                      | Spokane, Washington, USA
                    • Christian Dysthe
                      ... I only have it in ~/.vim/plugin. What confused me was that the spell checker actually loads, but the ec command needs to be issued for it to be working on
                      Message 10 of 11 , Jul 3, 2003
                      • 0 Attachment
                        On Wed, 02 Jul 2003, Gary Johnson wrote:

                        > :help runtimepath
                        >
                        > shows the list of places from which vim loads plugins. Unless there
                        > is something wrong with your setup, engspchk.vim should load
                        > automatically just as well from ~/.vim/plugin/engspchk.vim as from
                        > /usr/share/vim/plugin. Note, however, that the plugin does not
                        > print all those messages the first time it loads--it prints them
                        > only on subsequent loads or when \ec is executed, at least in my
                        > experimentation.
                        >
                        > So, do you have engspchk.vim in _only_ /usr/share/vim/plugin or do
                        > you have it in both ~/.vim/plugin _and_ /usr/share/vim/plugin? If
                        > you have it in both places, it will be loaded automatically twice
                        > and will print those messages the second time it is loaded.

                        I only have it in ~/.vim/plugin. What confused me was that the spell
                        checker actually loads, but the \ec command needs to be issued for it
                        to be working on the buffer. However, since I want vim to have the
                        spell checker not only loaded, but also have it check as I type I have
                        added this to .vimrc:

                        autocmd BufEnter * silent normal \ec

                        Now the spell checker is silently loaded and ready to go for mail and
                        all other files I open with vim. I do not have to enter the \ec
                        command to activate it. I guess I now can work on excluding certain
                        file types from spell checking also if needed.
                        >
                        > Gary
                        >
                        > -- Gary Johnson | Agilent Technologies
                        > garyjohn@... | Wireless Division | Spokane,
                        > Washington, USA
                        >


                        --
                        //Christian
                        Registered Linux User #228949 at: http://counter.li.org/

                        -- What if it all means something? --
                      • Antoine J. Mechelynck
                        Christian Dysthe wrote: [...] ... [...] Shouldn t BufRead,BufNewFile (and maybe limited to the filenames you want to spell-check) be
                        Message 11 of 11 , Jul 3, 2003
                        • 0 Attachment
                          Christian Dysthe <christian@...> wrote:
                          [...]
                          > I only have it in ~/.vim/plugin. What confused me was that the spell
                          > checker actually loads, but the \ec command needs to be issued for it
                          > to be working on the buffer. However, since I want vim to have the
                          > spell checker not only loaded, but also have it check as I type I have
                          > added this to .vimrc:
                          >
                          > autocmd BufEnter * silent normal \ec
                          [...]

                          Shouldn't BufRead,BufNewFile (and maybe limited to the filenames you want to
                          spell-check) be enough? (After all, IIUC, you don't need to have the
                          activate command issued whenever you leave the text buffer [for instance to
                          display some help] and go back to it).

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