2

I'm using split windows (LyX calls the shortcut view-split), but to switch which one I'm typing in, I have to click it. Is there a way to do switch active windows by using a keyboard shortcut? I've checked Tools > Preferences… > Editing > Shortcuts, but can't find anything obvious.

2

This is not currently possible in LyX. I suggest you create an enhancement request at https://www.lyx.org/trac (I don't think I've seen it requested before).

If you have an idea for the LFUN name, feel free to mention it. For example, perhaps view-forward and view-backward.

Workaround: If you happen to be on Linux, you can cook up some black magic with xdotool. Just make an OS shortcut to simulate a click on the left-hand side of your screen, and a separate one to simulate a click on the right-hand side of the screen. For me (1368 x 768 resolution), the following works for switching to the left view:

mousemove 200 200 click 1

and to switch to the right:

mousemove 800 200 click 1

If you want your cursor position to be remembered in each view, we can increase the black magic by using xdotool combined with LyX's bookmarks. I didn't test, but I think it would work well.

  • Thanks (+1). Yes I'm on Linux, so xdotool is plausible. However, as you say, I'd lose my cursor position. Not a bad idea with the bookmarks… pretty fiddly though, but it might be the only option. Also, bug filed. – Sparhawk Mar 16 '17 at 0:59
  • @Sparhawk did you try using LyX's bookmarks? The idea is, if you are in the left pane, your shortcut would first save to bookmark position 1, then switch panes (using xdotool), then recall bookmark position 2. And for the other shortcut (when you are in the right pane and want to move to the left), you first save to bookmark position 2, switch panes (using xdotool), then recall bookmark position 1. – scottkosty Mar 16 '17 at 1:12
  • Yes, that worked perfectly for me. I was thinking more of coding the whole sequence into xdotool, but I should probably just use the mouse for now and do some work instead. :p I'll accept your answer for now, unless something more complete comes along. Thanks! – Sparhawk Mar 16 '17 at 1:20
  • 1
    @Sparhawk hopefully the feature request is addressed so in the future no workaround is needed. – scottkosty Mar 16 '17 at 1:33
  • For Mac users, [BetterTouchTool] (boastr.net) is useful to move between split windows. I use, for example, Key Sequence (e.g. @LL for the lower half) with Move Mouse to Position + Left Click to move from the upper half of the window to the lower half. – T_T May 25 '17 at 4:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.