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

Re: Async to process some task in vim

Expand Messages
  • Gary Johnson
    ... You can easily generate tags and cscope data in the background with ... The problem is knowing when they re done. For that, you could do ... Using grep is
    Message 1 of 4 , Apr 1 12:18 PM
      On 2012-03-31, 曾波 wrote:
      > dear all,
      >
      >       when i process creating tags, cscope, grep find in a large project, vim
      > will suspend since this task finish.
      >
      > it's very annoying!  do you have some good idea?

      You can easily generate tags and cscope data in the background with
      commands like these:

      :!ctags -R &
      :!cscope -R -b &

      The problem is knowing when they're done. For that, you could do
      something like this:

      :!{ ctags -R; xmessage 'ctags done'; } &

      Using grep is a little trickier because you usually want to read the
      results into a quickfix list. For that, you could do something like
      this:

      !{ grep -Rn pattern . > ~/mygrep.out; xmessage 'grep done'; } &

      followed by this when that is done:

      :let &efm=&gfm
      :cf ~/mygrep.out

      Regards,
      Gary

      --
      You received this message from the "vim_use" 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 Fritz
      ... Or, to view the results, you can call back into Vim using the client-server interface. Some examples (for Windows, but many of the concepts will apply
      Message 2 of 4 , Apr 2 7:08 AM
        On Sunday, April 1, 2012 2:18:29 PM UTC-5, Gary Johnson wrote:
        > On 2012-03-31, 曾波 wrote:
        > > dear all,
        > >
        > >       when i process creating tags, cscope, grep find in a large project, vim
        > > will suspend since this task finish.
        > >
        > > it's very annoying!  do you have some good idea?
        >
        > You can easily generate tags and cscope data in the background with
        > commands like these:
        >
        > :!ctags -R &
        > :!cscope -R -b &
        >
        > The problem is knowing when they're done. For that, you could do
        > something like this:
        >
        > :!{ ctags -R; xmessage 'ctags done'; } &
        >
        > Using grep is a little trickier because you usually want to read the
        > results into a quickfix list. For that, you could do something like
        > this:
        >
        > !{ grep -Rn pattern . > ~/mygrep.out; xmessage 'grep done'; } &
        >
        > followed by this when that is done:
        >
        > :let &efm=&gfm
        > :cf ~/mygrep.out
        >
        > Regards,
        > Gary

        Or, to view the results, you can call back into Vim using the client-server interface. Some examples (for Windows, but many of the concepts will apply generally) can be found here:

        http://vim.wikia.com/wiki/Execute_external_programs_asynchronously_under_Windows

        --
        You received this message from the "vim_use" 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.