Ed S. Peschko wrote:
> On Sun, Sep 16, 2007 at 02:39:10PM +0200, Bram Moolenaar wrote:
>>
>> Ed Peschko wrote:
>>
>>> I know it's been discussed before, but how easy would it be to make:
>>>
>>> 1. uniq (and other commonly used %! commands to sort input) native
>>> to vim.
>> Use the built-in ":sort" command with the "u" flag.
>
> cool... although I did look for this in the docs, and didn't find any...
> are there any on the built-in flags besides 'u' to sort
> (like say 'uc' for uniq+count, or 'ud' for uniq+duplicated)?
>
>>> 2. vim take a list of files as an input (ie: vim -l filelist)
>> It's a bit more typing, but you can do it:
>>
>> vim '+n `=readfile("/tmp/filelist")`'
>
> ok, that works, but as:
>
> gvim "+n `=readfile('aha')`"
>
> due to braindead cmd pathing. I'm having a bit of trouble parsing how this
> works though.. I don't see anything in the gvim usage page about '+n' as an
> argument (or any other '+<char>' arguments). What I do see is:
>
> + Start at end of file
> +<lnum> Start at line <lnum>
>
>
> Is this sending the results of an 'ed' command back to gvim, or ???
>
>
> Anyways, both seem to work, so I'm happy, but again, I'm a bit uneasy on
> using the second because I don't know how it's working (and hence probably
> don't know a whole swathe of functionality in how vim itself works)
>
> Ed
Under ":help -+c":
> +{command} *-+c* *-c*
> -c {command} {command} will be executed after the first file has been
> read (and after autocommands and modelines for that file have
> been processed). "command" is interpreted as an Ex command.
> If the "command" contains spaces, it must be enclosed in
> double quotes (this depends on the shell that is used).
> Example: >
> vim "+set si" main.c
> vim "+find stdio.h"
> vim -c "set ff=dos" -c wq mine.mak
> <
> Note: You can use up to 10 "+" or "-c" arguments in a Vim
> command. They are executed in the order given. A "-S"
> argument counts as a "-c" argument as well.
> {Vi only allows one command}
(from:
*editing.txt* For Vim version 7.1. Last change: 2007 Jun 12
)
"+n" is the ":next" command; when followed by one or more filenames, it is the
same as the ":args" command.
Best regards,
Tony.
--
Wood is highly ecological, since trees are a renewable resource. If
you cut down a tree, another will grow in its place. And if you cut
down the new tree, still another will grow. And if you cut down that
tree, yet another will grow, only this one will be a mutation with
long, poisonous tentacles and revenge in its heart, and it will sit
there in the forest, cackling and making elaborate plans for when you
come back.
Wood heat is not new. It dates back to a day millions of years ago,
when a group of cavemen were sitting around, watching dinosaurs rot.
Suddenly, lightning struck a nearby log and set it on fire. One of the
cavemen stared at the fire for a few minutes, then said: "Hey! Wood
heat!" The other cavemen, who did not understand English, immediately
beat him to death with stones. But the key discovery had been made,
and from that day forward, the cavemen had all the heat they needed,
although their insurance rates went way up.
-- Dave Barry, "Postpetroleum Guzzler"
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---