browse in the quickfix window

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

browse in the quickfix window

Woody Wu
Hi,

In the quickfix window (opened by :cw), I hit a ENTER on an item and
the cursor jumps to the main window, this is fine in some cases. But
what do I do if I want the cursor stay on the quickfix window and just
like to see the contents of the other window changes?

Thanks.

--
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 ([hidden email])

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: browse in the quickfix window

Michael Wookey-3
2009/12/28 Steven Woody <[hidden email]>:
> In the quickfix window (opened by :cw), I hit a ENTER on an item and
> the cursor jumps to the main window, this is fine in some cases. But
> what do I do if I want the cursor stay on the quickfix window and just
> like to see the contents of the other window changes?

Maybe something like this?

nnoremap <silent> <C-j> :cnext<CR>
nnoremap <silent> <C-k> :cprevious<CR>

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: browse in the quickfix window

Woody Wu
2009/12/30 Michael Wookey <[hidden email]>:

> 2009/12/28 Steven Woody <[hidden email]>:
>> In the quickfix window (opened by :cw), I hit a ENTER on an item and
>> the cursor jumps to the main window, this is fine in some cases. But
>> what do I do if I want the cursor stay on the quickfix window and just
>> like to see the contents of the other window changes?
>
> Maybe something like this?
>
> nnoremap <silent> <C-j> :cnext<CR>
> nnoremap <silent> <C-k> :cprevious<CR>
>
I still want to see the error list and want to really browse on it,
just don't want window switching. :)


--
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 ([hidden email])

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: browse in the quickfix window

Tom Link-3
> I still want to see the error list and want to really browse on it,
> just don't want window switching. :)

I guess you could define a map that activates an entry in the quickfix
window and then jumps back again.

trag includes a command :TRagcw which you could like or maybe not.

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: browse in the quickfix window

Michael Wookey-3
In reply to this post by Woody Wu
2010/1/13 Steven Woody <[hidden email]>:

> 2009/12/30 Michael Wookey <[hidden email]>:
>> 2009/12/28 Steven Woody <[hidden email]>:
>>> In the quickfix window (opened by :cw), I hit a ENTER on an item and
>>> the cursor jumps to the main window, this is fine in some cases. But
>>> what do I do if I want the cursor stay on the quickfix window and just
>>> like to see the contents of the other window changes?
>>
>> Maybe something like this?
>>
>> nnoremap <silent> <C-j> :cnext<CR>
>> nnoremap <silent> <C-k> :cprevious<CR>
>>
>
> I still want to see the error list and want to really browse on it,
> just don't want window switching. :)
Try using :copen (or map it) first.

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: browse in the quickfix window

Michael Wookey-3
2010/1/13 Michael Wookey <[hidden email]>:

> 2010/1/13 Steven Woody <[hidden email]>:
>> 2009/12/30 Michael Wookey <[hidden email]>:
>>> 2009/12/28 Steven Woody <[hidden email]>:
>>>> In the quickfix window (opened by :cw), I hit a ENTER on an item and
>>>> the cursor jumps to the main window, this is fine in some cases. But
>>>> what do I do if I want the cursor stay on the quickfix window and just
>>>> like to see the contents of the other window changes?
>>>
>>> Maybe something like this?
>>>
>>> nnoremap <silent> <C-j> :cnext<CR>
>>> nnoremap <silent> <C-k> :cprevious<CR>
>>>
>>
>> I still want to see the error list and want to really browse on it,
>> just don't want window switching. :)
>
> Try using :copen (or map it) first.
Or, combine the two together like so...

nnoremap <silent> <C-j> :copen<CR>:cnext<CR>
nnoremap <silent> <C-k> :copen<CR>:cprevious<CR>

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: browse in the quickfix window

Christian Brabandt
In reply to this post by Woody Wu
On Tue, January 12, 2010 3:31 pm, Steven Woody wrote:
> I still want to see the error list and want to really browse on it,
> just don't want window switching. :)

Well, the brutal method would be to issue an autocommand on window leave.
So if you issue in your quickfix window this command:
:au WinLeave <buffer> :call feedkeys("copen\n")
you won't be able to leave the window. Use :au! WinLeave to delete this
autocommand.

But I doubt this is really a good idea. :cclose won't be able to close
the window then. You would need to exit the quickfix window by using :q

regards,
Christian


--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: browse in the quickfix window

Marko Mahnič
In reply to this post by Woody Wu
On Dec 28 2009, 10:56 am, Steven Woody <[hidden email]> wrote:
> Hi,
>
> In the quickfix window (opened by :cw), I hit a ENTER on an item and
> the cursor jumps to the main window, this is fine in some cases. But
> what do I do if I want the cursor stay on the quickfix window and just
> like to see the contents of the other window changes?
>

Hi,

You may be interested in a plugin that is a part of the vimuiex
project.
When the filetype of a buffer is set to 'qf' (QuickFix), two new
mappings
are added to the QuickFix buffer:
   <space> - preview the current item in a preview window
   <cr> - close the preview window and jump to current item
(Mappings may become configurable in a future release.)
Use :copen to display the QuickFix buffer.

Since this is part of the VxLib library, python is not required and
also the patch that is needed for vimuiex need not be applied.
You only need to install vimuiex.zip from:
  http://www.vim.org/scripts/script.php?script_id=2606

Marko

------
Some code from vxlib#cmd
" /plugin
autocmd FileType qf call vxlib#cmd#PrepareQFixPreview()

" /autoload
function! vxlib#cmd#ShowQFixPreview()
   let lnn = line('.')
   let pos = getqflist()[lnn-1]
   call vxlib#cmd#PreviewLine(pos['bufnr'], pos['lnum'])
endfunc

function! vxlib#cmd#PrepareQFixPreview()
   nmap <silent> <Space> :call vxlib#cmd#ShowQFixPreview()<CR>
   nnoremap <silent> <CR> :pclose<CR><CR>
endfunc

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
Reply | Threaded
Open this post in threaded view
|

Re: browse in the quickfix window

Woody Wu
2010/1/15 mmarko <[hidden email]>:

> On Dec 28 2009, 10:56 am, Steven Woody <[hidden email]> wrote:
>> Hi,
>>
>> In the quickfix window (opened by :cw), I hit a ENTER on an item and
>> the cursor jumps to the main window, this is fine in some cases. But
>> what do I do if I want the cursor stay on the quickfix window and just
>> like to see the contents of the other window changes?
>>
>
> Hi,
>
> You may be interested in a plugin that is a part of the vimuiex
> project.
> When the filetype of a buffer is set to 'qf' (QuickFix), two new
> mappings
> are added to the QuickFix buffer:
>   <space> - preview the current item in a preview window
>   <cr> - close the preview window and jump to current item
> (Mappings may become configurable in a future release.)
> Use :copen to display the QuickFix buffer.
>
> Since this is part of the VxLib library, python is not required and
> also the patch that is needed for vimuiex need not be applied.
> You only need to install vimuiex.zip from:
>  http://www.vim.org/scripts/script.php?script_id=2606
>
> Marko
>
It sounds good. I will try it.  Thanks!
--
Life is the only flaw in an otherwise perfect nonexistence
    -- Schopenhauer

narke
public key at http://subkeys.pgp.net:11371 ([hidden email])

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php