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
I don't think adding this syntax is a good idea, as it conflicts with opening named data streams on Windows. It also could conflict with drive letter syntax if <filename> is a single alpha character.
Craig
I am affraid everything what is in IT is conflicting with Windows :) .
That should not stop IT to evolve.
There are tons of settings that differ from **x to windows. Some of
the behaviour is automatically
changed some are switchid with variables. The same can happen with this one
rgrds,
This can be achieved via an autocmd; in fact, the file-line plugin provides this
functionality:
http://www.vim.org/scripts/script.php?script_id=2184
-- cheers, ingo
--
-- Ingo Karkat -- /^-- /^-- /^-- /^-- /^-- /^-- http://ingo-karkat.de/ --
-- http://vim.sourceforge.net/account/profile.php?user_id=9713 --
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.
Thanks for describing the 2 ways. I am not happy if I would disappoint
you for writing that down, but I was aware about those.
What I was a bit annoyed, is that a format that is output of several
commands used everyday by most of us, is not accepted as "standard"
command line. I have created for myself a wrapper that converts
file:line into file +line.
So my wrapper is wrvim and
wrvim file:line
is the same as
wrvim file +line
--
rgrds,
Why don't you use the file-line.vim plugin? I mentioned it a month ago in
exactly the current thread:
http://groups.google.com/group/vim_dev/msg/722aefe8494c3a44
-- cheers, ingo