Re: Positioning on a given char offset

2006-06-12 Thread Tim Chase

I have this problem: a program of mine is giving me error positions
based on the file offset and not the line containing the error.
Eg. it does not warn me about an error on line "12", but at the "char 2032"

Is there any command in Vim to position to that char offset?


If the data is on one line, the pipe command takes a column 
offset, so in normal mode, just use


2032|

(that's "two zero three two pipe")

A fabulous feature when you're dealing with data where columns 
matter (as in column-delimited data files) that drives me nuts 
when I don't have it in other editors.  Score yet one more point 
for vim. :)


If the data is *not* all on one line, you can use "[count]go" in 
normal mode, or ":[count]go" in Ex mode to go to the particular 
byte-offset in the file.  So in your case, you can just use


2032go
or
:2032go
or
:go 2032

You can learn more at

:help bar
:help :go

-tim






Re: Positioning on a given char offset

2006-06-12 Thread A.J.Mechelynck

Fabio Rotondo wrote:

Hi,

I have this problem: a program of mine is giving me error positions
based on the file offset and not the line containing the error.
Eg. it does not warn me about an error on line "12", but at the "char 2032"

Is there any command in Vim to position to that char offset?

Thanks,

Fabio


  

   :go 2032
(with colon), or
   2032go
(without colon)

Requires +byte_offset feature, i.e., has("byte_offset") must return a 
nonzero value, normally 1. This means "Normal", "Big" or "Huge" features.


see ":help go"


HTH,
Tony.


Re: Positioning on a given char offset

2006-06-12 Thread Mathias Michaelis
Hi Fabio

> Eg. it does not warn me about an error on line "12", but at the "char 2032"
> 
> Is there any command in Vim to position to that char offset?
> 
Maybe

:2032go

?

With kind regards

Mathias