On 2010-10-15, Jim Green wrote:
> On Oct 15, 9:31 am, Gary Johnson <garyj...@spocom.com> wrote:
> > This is what I did.
> >
> > $ vim -N -u NONE
> > :set cursorline
> > :au FileType QF nmap <buffer> <cr> <cr><c-w><c-p>
> > :grep PATTERN *
> > :cw
> >
> > where PATTERN is a string I knew would be found in some files in the
> > current directory, and 'cursorline' is set to more easily see the
> > cursor movement in the top buffer.
> >
> > At this point, moving the cursor in the quickfix window and hitting
> > Enter works as advertised:  the cursor moves to the correct file and
> > line in the top window and returns to the quickfix window.
> 
> This works well, but looks like set cursorline is global, could I have
> a cursorline just when I do :grep and :cw ?

It looked to me like it was global, too, but ":help cursorline" says
that it's local to the window.  What's happening is that new windows
inherit at least some of the settings of the windows from which they
are created.

If you wanted to set 'cursorline' when doing :grep, you could use
this autocommand:

    au QuickFixCmdPre * set cursorline

I haven't found a way to automatically turn the 'cursorline' off
when the quickfix window is closed, though.

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

Reply via email to