Mario, Mario D <egalua <at> gmail.com> writes: > Paul, > > surely I do not demand to lyx to recognize addends in a formula like "y = x + 2z". Maybe I can explain better myself with an example, so please let me write a formula with a few markers for the cursor position. > > Consider \frac{1}{2} + \left(1+1\right) = 2.5 > > > ^ ^ ^ ^ ^ > > A B C D E > > Wherever I am, if I hit ctrl+right I am driven to E.
Sorry, I cannot tell where A ... E point to. I view the list in a web browser, and since the example was not tagged "preformatted", proportional fonts were used to render it, messing up the spacing. If you place the cursor in the numerator of the fraction (immediately before 1) and hit ctrl-right, do you still jump to E. With the cua binding, ctrl-right skips over the 1 but stays in the numerator (at least for me). Similarly, if I position the cursor just inside the \left(, before the second of three instances of 1, ctrl-right jumps over 1+1 and puts me just inside the \right). > > What I would like is that if I am in A I land in B and if I am in C I go to D > > > Please note that if I hit shift+right and I am in A then all the A-B portion of the formula is selected and similarly if I am in C with shift+right I get C-D selected. > > This means that lyx can recognize these chunks of code because, as you said, lyx understands insets (or subenvironments, if you prefer). > > What I have not been able to understand is which function I should bind to ctrl+right so that this combination drives me from A to B or from C to D instead of from everywhere to E > > > Incidentally, I also do not like very much the fact that if in A then shift+right selects all the A-B portion of the formula: in my view, this should be the behavior of > > ctrl+shift+right, whereas shift+right should select only the very next character (that is, the numerator if I am in A). Wish I knew where A and B are. :-) If I put the cursor just outside the parenthesized expression -- immediately before \left( -- and hit shift-right, the entire expression (1 + 1) is selected, including parentheses. If I move the cursor just inside the left parenthesis, shift-right selects just 1. > > I wish I have explained better my question. > > For completeness and reproducibility, I add that some of my current bindings (the ones which seem relevant to me) are: > > > shift+right: char-right-select > > ctrl+right: word-right > > ctrl+shift+right: word-right-select These are the same bindings I have. Perhaps you can repost your example, between pre and /pre tags? Paul