2

I'm viewing a wide (not necessary long) file using the less utility, without line wrapping.

I can move right and left using my arrow keys (and even that's due to terminal magic I'm not well-versed in, since "right arrow" is not an character you can type in); but I don't know to:

  • Move a single character to the left/right
  • Move a full screen to the left/right
  • Move a hal-screen to the left/right
  • Move to the beginning of the line
  • Move to the end of the line

Now, looking at the help page, I see:

     23   ESC-)  RightArrow *  Right one half screen width (or N positions).
     24   ESC-(  LeftArrow  *  Left  one half screen width (or N positions).
     25   ESC-}  ^RightArrow   Right to last column displayed.
     26   ESC-{  ^LeftArrow    Left  to first column.

But that doesn't seem to to work for me. Also, it's weird to press Esc+Shift+0 (to get ESC+)).

How does horizontal movement actually work? And - can I make it easier, e.g. for Ctrl+RightArrow and Ctrl+LeftArrow at least to do something useful?

1 Answer 1

3

and move horizontally by half the screen width by default, but this can be changed using the -# (--shift) option. You can set this on the command-line or at runtime: in less, press -# followed by the new shift amount. Shift amounts can be specified as absolute positions (e.g. 80), or a fraction of the screen width (e.g. 0.9).

Esc) is equivalent to , Esc( is equivalent to . The Ctrl variants don’t work for me, I have to use Esc{ and Esc}.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .