Re: cmap and :BufGrep from greputils.vim
- I was on vacation and couldn't respond immediately.
It seems very strange that the map doesn't work. When I tried variations
:cmap <C-G> BufGrep <cword><CR>:echo 'hello'<CR>
and even executing a user command like this:
:command -nargs=* Echo :echo <args>
:cmap <C-G> BufGrep <cword><CR>:Echo 'hello'<CR>
it works fine. I also verified that Vim is in the right buffer after
BufGrep is executed, as :Cfile is local to the Grep Preview buffer. I
have no clue on why it wouldn't work.
But for your needs, if you always want Cfile to be executed at the end,
you can just add the call to Cfile at the end of the s:VimGrep()
function (untested). Let me know if this doesn't workout for you.
On Thu, 2 Dec 2004 at 10:15pm, R. shankar wrote:
> Hi All,
> I am using GrepUtils utility by Hari Krishna.
> I want a simple mapping such that, I put a cursor under a word, and press a
> then the :BufGrep <cword> command is executed and the :Cfile command is also
> I tried this.
> :cmap <C-G> BufGrep <cword><CR>:Cfile<CR>
> It works when I type this command and execute.
> I added this to the .vimrc and tried to issue the command :<C-G>. It executed
the BufGrep command but did not execute the :Cfile command.
> I am not sure why this is happening.
> Also, it would be great, if get the quickfix window directly after executing
the :BufGrep command instead of a preview window and then converting to the
quickfix window. Any changes to be made to greputils.vim
Do you Yahoo!?
Yahoo! Mail - Easier than ever with enhanced search. Learn more.