3

I am using nano on files with long lines. How could I scroll the nano window horizontally?

Ex:

┌────────────┐
|Lorem ipsum |dolor sit amet, consectetur adipiscing elit, 
|sed do eiusm|od tempor incididunt ut labore et dolore magna aliqua. 
|Dolor sed vi|verra ipsum nunc aliquet bibendum enim.
|In massa tem|por nec feugiat. Nunc aliquet bibendum enim facilisis gravida. 
└────────────┘

I would like scrolling right side:

            ┌────────────┐
Lorem ipsum |dolor sit am|et, consectetur adipiscing elit, 
sed do eiusm|od tempor in|cididunt ut labore et dolore magna aliqua. 
Dolor sed vi|verra ipsum |nunc aliquet bibendum enim.
In massa tem|por nec feug|iat. Nunc aliquet bibendum enim facilisis gravida. 
            └────────────┘
  • 2
    +1, but I suspect the answer is "you can't", and the better answer is "use vim". (And the slightly less better answer is "use emacs". :p) – Sparhawk Jul 18 at 7:12
  • 2
    +1, also because I appreciate ASCII art ;) – dr01 Jul 18 at 11:09
1

I'm pretty sure you cannot do that in nano. The closest you could get would be line wrapping, precisely "soft wrapping": Esc+$.

This will wrap lines so you could see them all on the screen.

Source: https://www.nano-editor.org/dist/v2.9/nano.html (search for --softwrap)

You could get this kind of behaviour with vim, though, the editor is more configurable. See: https://ddrscott.github.io/blog/2016/sidescroll/

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.