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

Re: execute user defined command and press enter

Expand Messages
  • Gary Johnson
    ... That depends on what s causing it to need the enter. I don t have a VimGrep() function installed, so I used an arbitrary function from :help functions
    Message 1 of 3 , Apr 3, 2013
      On 2013-04-03, FlashBurn wrote:
      > I created the following command
      > command! -nargs=1 Vim :call VimGrep("<args>", g:dir_list) | copen | cc
      > The problem that I'm having is that it is asking me to press enter
      > after it is executed. How can I avoid it? How can I make it open
      > the quickfix list automatically without vim telling me to press
      > enter. I tried putting <cr> at the end of the command, but then I
      > get following error:
      > E488: Trailing characters cc^M
      > Any help is appreciated.

      That depends on what's causing it to need the enter. I don't have a
      VimGrep() function installed, so I used an arbitrary function from
      ":help functions" instead.

      :command! -nargs=1 Vim :call findfile("<args", "/usr/local/bin") | copen | cc

      Then I executed

      :Vim vim

      It worked fine. (I got the error "E42: No Errors", but that was to
      be expected.)

      So the problem may be from something inside your VimGrep() function.
      What does your command do if you don't include the "| copen | cc"
      part, i.e.,

      command! -nargs=1 Vim :call VimGrep("<args>", g:dir_list)


      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

      You received this message because you are subscribed to the Google Groups "vim_use" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    Your message has been successfully submitted and would be delivered to recipients shortly.