On 23/10/09 18:24, mobi phil wrote:
>
> Hello,
>
> lot of programs (gdb, gcc) have as output information about file and
> line in form of
>
> <filename>:<number>
>
> I wonder if it would not be clever to make vim accept such a syntax
> for opening file.
> Eventually with a flag that would switch on/off this syntax.
>
>
> This would be interesting both when opening a file:
>
> vim<filename>:<number>
>
> or internally
>
> :new/edit/split<filename>:<number>
>
> I know that you can specify in both forms the line number separatelly
> with +<linenum>, but
> the proposed form is much more handy if you copy paste info from
> commands like the mentioned
> ones
>
>
> thanks for your attennion,
> mobi phil
>
> being mobile, but including technology
> http://mobiphil.com

Vim has already two built-in mechanisms of this kind:

1) for a one-time opening of a file at a given position, see ":help +cmd"

        :e +123 foobar.txt
                open foobar.txt at line 123

        :e + foobar.txt
                open foobar.txt at end

        :e +/pattern foobar.txt
                open foobar.txt at the first line matching /pattern/

        :e +/pattern\ with\ spaces foobar.txt
                spaces must be backslash-escaped

etc.

2) if your program generates a number of such file-locations, like grep 
does, or like a make run with a number of errors and warnings: see
        :help quickfix.txt
        :help :compiler
        :help 'errorformat'
etc.


Best regards,
Tony.
-- 
Parker's Law:
        Beauty is only skin deep, but ugly goes clean to the bone.

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

Raspunde prin e-mail lui