On 11/04/09 02:12, Yue Wu wrote:
>
> On Sat, 11 Apr 2009 07:56:49 +0800, Tony Mechelynck
> <[email protected]>  wrote:
>
>>
>> On 11/04/09 00:45, Yue Wu wrote:
>> [...]
>>> It's right that vim must use the filename, line, column to jump to the
>>> match, but I think it can hide these relevant infos from error window,
>>> just use them transparently. That's the use of errorformat I thought,
>>> but
>>> I failed...
>>>
>>
>> IIUC, the 'errorformat' is not meant to tell Vim how to _display_ the
>> lines of the errorlist but how to _interpret_ them. If there were only
>> vimgrep, no 'errorformat' would be necessary, but there are a lot of
>> different compilers for a lot of different languages, and each of them
>> has different customs about how to display the directory, the file, the
>> line and the column. The 'errorformat' option tells Vim how to interpret
>> the output of the current compiler, and translate it from human-readable
>> to machine-readable: how to extract the directory, filename, line and
>> column from lines which may or may not be on the same line, while the
>> match may or may not be included at all in the compiler output, and use
>> all that info to display (in a different window) the source file with
>> the cursor as near to the error (or the grep match) as Vim can place it.
>>
>> All the quickfix commands were (IIUC) originally developed to aid users
>> in the compile - fix - recompile cycle, and (IIUC) grep, helpgrep and
>> vimgrep were added in that order as three successive afterthoughts, with
>> the "local list" facilities being added even later.
>
> Thank you for detailed explanation, any alternative way to do it? I want a
> matching results preview and the jumping to file position's feature.
>

Well, I see two posssibilities:

- with plain-vanilla Vim, create and use a custom colorscheme which 
would display everything in the quickfix window (except the source text 
of course) in colors linked to Ignore. This won't remove the space 
occupied by those "ignored" parts, it will only display them using 
"invisible" colours (i.e., fg=bg) the way the default Vim colouring 
displays, among others, the |bars| around help links and the *stars* 
around help tags in help files.

- if that isn't good  enough, apply Taylor Venable's unofficial patch 
(available from the "nonstandard patches" page of the vim_dev Google 
Group), compile Vim with it, and use that to hide whatever you don't 
want to see in the quickfix window. You may have to use well-chosen 
":setlocal" commands at some well-chosen autocommand event, maybe 
BufWinEnter or BufReadPost, testing for a quickfix window. I don't know 
the details because I don't use that patch myself.

If you go that second route, you had better make sure you're subscribed 
to the vim_dev list, just in case you get problems compiling and 
patching Vim.


Best regards,
Tony.
-- 
Like the ski resort of girls looking for husbands and husbands looking
for girls, the situation is not as symmetrical as it might seem.
                -- Alan McKay

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

Reply via email to