On 01/12/08 14:59, anhnmncb wrote:
> On 2008-12-01, Tony Mechelynck wrote:
>> On 01/12/08 13:42, anhnmncb wrote:
>>> Hi, list,
>>> I use vimgrep to search timeline like<\d\+-\d\+-\d\+> in my file, and let
>>> quckfix show me the result, the result sorted by line nubmer by default, I
>>> don't know how to let the result sorted by date?
>>>
>> The quickfix list is always sorted in the order matches (or errors, for
>> a make) were found. But you can use ":w filename" (or maybe ":saveas
>> filename" which is subtly different) to save a copy and then use the
>> ":sort" command.
>
> Yes, but I don't want this way, because sometimes I vimgrep a file which has
> crypted by vim and I don't want so many result written to a file and I forgot
> to del it.
>
> I tried to save buffer to a temporary list variable which each atom is a line
> in buffer then sort them and vimgrey, but without lucky (I'm a vimscript
> newbie).
>
>
Did you try internal ":sort" in the QF window? If it doesn't work, try
moving the contents of the quickfix window to some [No Name] window by
":%y" in the one then ":put" in the other (without the quotes in both
cases). Then try running an appropriate :sort.
Vimgrep is not very useful to search a single file (use plain "slash"
search then). It comes to hand when you have several (maybe many) files
to search for a given string or regexp.
IIUC, internal ":sort" (unlike external :!sort which is a filter)
doesn't need anything to be written out to disk.
Best regards,
Tony.
--
GALAHAD: No. Look, I can tackle this lot single-handed!
GIRLS: Yes, yes, let him Tackle us single-handed!
"Monty Python and the Holy Grail" PYTHON (MONTY)
PICTURES LTD
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"vim_use" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/vim_use?hl=en
-~----------~----~----~----~------~----~------~--~---