Lyx and vi

2009-09-01 Thread Ullrich Franke
Hi there,

sorry for warming up an old discussion.

I'm sitting in front of a large document in LyX right now and need to jump back 
and forth quite often.
Now what I'm missing (besides the whole vi bindings) is vi's ability to mark 
line numbers (m-command). I find this very useful for hopping around visiting 
other sections in my document and returning quickly to where I'm working by 
just pressing  '[buffer] .

Scrolling is quite painful, very slow and - when working inside floats _very_ 
unreliable. 
Using the Navigate-menu is fine, but does only work well for short sections; 
when I need to jump to the middle of some paragraph, I'm lost using pg{down,up}.

Is there an easy way to implement stuff like that?
After all these vi-discussions, has anybody measured the necessary work?

Is anybody actually working on it right now?
Where in the source should I start?

Regards,

-- 
Ullrich Franke


Re: Lyx and vi

2009-09-01 Thread Guenter Milde
On 2009-09-01, Ullrich Franke wrote:

 I'm sitting in front of a large document in LyX right now and need to
 jump back and forth quite often.
...
 Is there an easy way to implement stuff like that?

Did you try bookmarks (NavigierenLesezeichen)?

Günter 



RE: Lyx and vi

2009-09-01 Thread Vincent van Ravesteijn - TNW
 
I'm sitting in front of a large document in LyX right
now and need to jump back and forth quite often.
Now what I'm missing (besides the whole vi bindings)
is vi's ability to mark line numbers (m-command). I
find this very useful for hopping around visiting
other sections in my document and returning quickly
to where I'm working by just pressing  '[buffer] .

We have Navigate-Bookmarks for this. I don't know whether that is
approximately the same as the vi behaviour. Furthermore, we have now a
jump back button.

Scrolling is quite painful, very slow and - when
working inside floats _very_ unreliable. Using the
Navigate-menu is fine, but does only work well for
short sections; when I need to jump to the middle of
some paragraph, I'm lost using pg{down,up}.

I've recently changed the scrolling such that when pressing the same
number of PgDowns and PgUps the cursor would end up in exactly the same
position as before.

Moreover, I've proposed a new scrolling algorithm that is faster (and
hopefully better) and I'm planning to attack the problem of scrolling
and Insets in the near future.

Is there an easy way to implement stuff like that?

The scrolling part is a bit difficult to understand (at least it was for
me), and as I already mentioned, the stuff with cursor placement and
Insets is still a bit messy. Besides that, it depends a bit on you and
your plans whether it's easy.

After all these vi-discussions, has anybody measured the
necessary work?

Probably not. I also (re)implemented the screen-recenter feature that
people were used to in vi.

Is anybody actually working on it right now?

I don't think so (besides the things I mentioned above).

Where in the source should I start?

The scrolling stuff is mainly in BufferView.cpp. Search for things like:
LFUN_SCREEN_RECENTER, LFUN_SCREEN_SHOW_CURSOR, LFUN_SCREEN_UP/DOWN and
in LyXFunc.cpp (beware, this code is not at the right place) for
gotoBookmark() and LFUN_BOOKMARK_GOTO..

 Ullrich Franke

Vincent


Re: Lyx and vi

2009-09-01 Thread Ullrich Franke
Hi Vincent,

thanks for your quick reply.

On Tue, 1 Sep 2009 11:28:59 +0200
Vincent van Ravesteijn - TNW v.f.vanraveste...@tudelft.nl wrote:
  
 I'm sitting in front of a large document in LyX right
 now and need to jump back and forth quite often.
 Now what I'm missing (besides the whole vi bindings)
 is vi's ability to mark line numbers (m-command). I
 find this very useful for hopping around visiting
 other sections in my document and returning quickly
 to where I'm working by just pressing  '[buffer] .
 
 We have Navigate-Bookmarks for this. I don't know whether that is
 approximately the same as the vi behaviour. Furthermore, we have now a
 jump back button.

Navigate-Bookmarks is nearly the same, but not as easy and as fast to use.
(Besides vi gives you the opportunity to use those buffers in conjunction with 
e.g. delete, copy, write-to-file)

 
 I've recently changed the scrolling such that when pressing the same
 number of PgDowns and PgUps the cursor would end up in exactly the same
 position as before.
 
 Moreover, I've proposed a new scrolling algorithm that is faster (and
 hopefully better) and I'm planning to attack the problem of scrolling
 and Insets in the near future.
 

Ah, seems to me that the first task should be to bring current LyX to FreeBSD. 
We still have 1.5.7 here and 1.6.x waits for repo-copy to the ports-system.
(http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/128726)

Sorry for the noise.

 
  Ullrich Franke
 
 Vincent

Regards,

-- 
Ullrich Franke


Re: Lyx and vi

2009-09-01 Thread Guenter Milde
On 2009-09-01, Ullrich Franke wrote:
 Vincent van Ravesteijn - TNW wrote:

 We have Navigate-Bookmarks for this. I don't know whether that is
 approximately the same as the vi behaviour. Furthermore, we have now a
 jump back button.

 Navigate-Bookmarks is nearly the same, but not as easy and as fast to
 use. 

What exacly do you mean with

  just pressing  '[buffer] 

? Writing the string in  ? On my keyboard this would be Space, Shift-#,
AltGr-8, buffer, AltGr-9 not really easy and fast.

You can use the minibuffer or bind keys to the lfuns to set and goto
bookmarks. E.g. 

# bookmark
\bind M-Down  bookmark-save 0
\bind M-Upbookmark-goto 0


 (Besides vi gives you the opportunity to use those buffers in
 conjunction with e.g. delete, copy, write-to-file)

Is this something like different views of the same file/buffer?

Günter



Re: Lyx and vi

2009-09-01 Thread Andre Poenitz
On Tue, Sep 01, 2009 at 11:11:19AM +0200, Ullrich Franke wrote:
 Hi there,
 
 sorry for warming up an old discussion.
 
 I'm sitting in front of a large document in LyX right now and need to
 jump back and forth quite often.  Now what I'm missing (besides the
 whole vi bindings) is vi's ability to mark line numbers (m-command). I
 find this very useful for hopping around visiting other sections in my
 document and returning quickly to where I'm working by just pressing 
 '[buffer] .
 
 Scrolling is quite painful, very slow and - when working inside floats
 _very_ unreliable.  Using the Navigate-menu is fine, but does only
 work well for short sections; when I need to jump to the middle of
 some paragraph, I'm lost using pg{down,up}.
 
 Is there an easy way to implement stuff like that?  After all these
 vi-discussions, has anybody measured the necessary work?

You'll need around 3000-5000 lines to get basic movement, undo, some
register handling, basic ex commands and visual mode to get a rough vi
feeling (or at least something that covers the part of vi(m) that I
personally use...).
 
 Is anybody actually working on it right now?

None that I am aware of, at least not in the context of LyX.

 Where in the source should I start?

You'd probably need to put the machinery between GuiWorkArea::keyPressEvent()
and LyXFunc::processKeySym() and/or possibly replace LyXFunc::processKeySym().

Andre'


Lyx and vi

2009-09-01 Thread Ullrich Franke
Hi there,

sorry for warming up an old discussion.

I'm sitting in front of a large document in LyX right now and need to jump back 
and forth quite often.
Now what I'm missing (besides the whole vi bindings) is vi's ability to mark 
line numbers (m-command). I find this very useful for hopping around visiting 
other sections in my document and returning quickly to where I'm working by 
just pressing " '[buffer] ".

Scrolling is quite painful, very slow and - when working inside floats _very_ 
unreliable. 
Using the Navigate-menu is fine, but does only work well for short sections; 
when I need to jump to the middle of some paragraph, I'm lost using pg{down,up}.

Is there an "easy" way to implement stuff like that?
After all these vi-discussions, has anybody measured the necessary work?

Is anybody actually working on it right now?
Where in the source should I start?

Regards,

-- 
Ullrich Franke


Re: Lyx and vi

2009-09-01 Thread Guenter Milde
On 2009-09-01, Ullrich Franke wrote:

> I'm sitting in front of a large document in LyX right now and need to
> jump back and forth quite often.
...
> Is there an "easy" way to implement stuff like that?

Did you try bookmarks (Navigieren>Lesezeichen)?

Günter 



RE: Lyx and vi

2009-09-01 Thread Vincent van Ravesteijn - TNW
 
>I'm sitting in front of a large document in LyX right
>now and need to jump back and forth quite often.
>Now what I'm missing (besides the whole vi bindings)
>is vi's ability to mark line numbers (m-command). I
>find this very useful for hopping around visiting
>other sections in my document and returning quickly
>to where I'm working by just pressing " '[buffer] ".

We have Navigate->Bookmarks for this. I don't know whether that is
approximately the same as the vi behaviour. Furthermore, we have now a
jump back button.

>Scrolling is quite painful, very slow and - when
>working inside floats _very_ unreliable. Using the
>Navigate-menu is fine, but does only work well for
>short sections; when I need to jump to the middle of
>some paragraph, I'm lost using pg{down,up}.

I've recently changed the scrolling such that when pressing the same
number of PgDowns and PgUps the cursor would end up in exactly the same
position as before.

Moreover, I've proposed a new scrolling algorithm that is faster (and
hopefully better) and I'm planning to attack the problem of scrolling
and Insets in the near future.

>Is there an "easy" way to implement stuff like that?

The scrolling part is a bit difficult to understand (at least it was for
me), and as I already mentioned, the stuff with cursor placement and
Insets is still a bit messy. Besides that, it depends a bit on you and
your plans whether it's "easy".

>After all these vi-discussions, has anybody measured the
>necessary work?

Probably not. I also (re)implemented the "screen-recenter" feature that
people were used to in vi.

>Is anybody actually working on it right now?

I don't think so (besides the things I mentioned above).

>Where in the source should I start?

The scrolling stuff is mainly in BufferView.cpp. Search for things like:
LFUN_SCREEN_RECENTER, LFUN_SCREEN_SHOW_CURSOR, LFUN_SCREEN_UP/DOWN and
in LyXFunc.cpp (beware, this code is not at the right place) for
gotoBookmark() and LFUN_BOOKMARK_GOTO..

> Ullrich Franke

Vincent


Re: Lyx and vi

2009-09-01 Thread Ullrich Franke
Hi Vincent,

thanks for your quick reply.

On Tue, 1 Sep 2009 11:28:59 +0200
"Vincent van Ravesteijn - TNW"  wrote:
>  
> >I'm sitting in front of a large document in LyX right
> >now and need to jump back and forth quite often.
> >Now what I'm missing (besides the whole vi bindings)
> >is vi's ability to mark line numbers (m-command). I
> >find this very useful for hopping around visiting
> >other sections in my document and returning quickly
> >to where I'm working by just pressing " '[buffer] ".
> 
> We have Navigate->Bookmarks for this. I don't know whether that is
> approximately the same as the vi behaviour. Furthermore, we have now a
> jump back button.

Navigate->Bookmarks is nearly the same, but not as easy and as fast to use.
(Besides vi gives you the opportunity to use those buffers in conjunction with 
e.g. delete, copy, write-to-file)

> 
> I've recently changed the scrolling such that when pressing the same
> number of PgDowns and PgUps the cursor would end up in exactly the same
> position as before.
> 
> Moreover, I've proposed a new scrolling algorithm that is faster (and
> hopefully better) and I'm planning to attack the problem of scrolling
> and Insets in the near future.
> 

Ah, seems to me that the first task should be to bring current LyX to FreeBSD. 
We still have 1.5.7 here and 1.6.x waits for repo-copy to the ports-system.
(http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/128726)

Sorry for the noise.

> 
> > Ullrich Franke
> 
> Vincent

Regards,

-- 
Ullrich Franke


Re: Lyx and vi

2009-09-01 Thread Guenter Milde
On 2009-09-01, Ullrich Franke wrote:
> "Vincent van Ravesteijn - TNW" wrote:

>> We have Navigate->Bookmarks for this. I don't know whether that is
>> approximately the same as the vi behaviour. Furthermore, we have now a
>> jump back button.

> Navigate->Bookmarks is nearly the same, but not as easy and as fast to
> use. 

What exacly do you mean with

>> > just pressing " '[buffer] "

? Writing the string in "" ? On my keyboard this would be Space, Shift-#,
AltGr-8, buffer, AltGr-9 not really easy and fast.

You can use the minibuffer or bind keys to the lfuns to set and goto
bookmarks. E.g. 

# bookmark
\bind "M-Down"  "bookmark-save 0"
\bind "M-Up""bookmark-goto 0"


> (Besides vi gives you the opportunity to use those buffers in
> conjunction with e.g. delete, copy, write-to-file)

Is this something like different views of the same file/buffer?

Günter



Re: Lyx and vi

2009-09-01 Thread Andre Poenitz
On Tue, Sep 01, 2009 at 11:11:19AM +0200, Ullrich Franke wrote:
> Hi there,
> 
> sorry for warming up an old discussion.
> 
> I'm sitting in front of a large document in LyX right now and need to
> jump back and forth quite often.  Now what I'm missing (besides the
> whole vi bindings) is vi's ability to mark line numbers (m-command). I
> find this very useful for hopping around visiting other sections in my
> document and returning quickly to where I'm working by just pressing "
> '[buffer] ".
> 
> Scrolling is quite painful, very slow and - when working inside floats
> _very_ unreliable.  Using the Navigate-menu is fine, but does only
> work well for short sections; when I need to jump to the middle of
> some paragraph, I'm lost using pg{down,up}.
> 
> Is there an "easy" way to implement stuff like that?  After all these
> vi-discussions, has anybody measured the necessary work?

You'll need around 3000-5000 lines to get basic movement, undo, some
register handling, basic ex commands and visual mode to get a rough "vi
feeling" (or at least something that covers the part of vi(m) that I
personally use...).
 
> Is anybody actually working on it right now?

None that I am aware of, at least not in the context of LyX.

> Where in the source should I start?

You'd probably need to put the machinery between GuiWorkArea::keyPressEvent()
and LyXFunc::processKeySym() and/or possibly replace LyXFunc::processKeySym().

Andre'