New answers tagged less
Thor's answer didn't mention disabling the vertical "scrollopt", which makes both windows scroll vertically. So for me the complete solution is pasting this into vim: :set scrollopt+=hor :set scrollopt-=ver :set nowrap :1split :windo set scrollbind
Clearing the line has only an indirect relationship to changing the terminal colors: if you change the background color, then many terminals (Linux console, rxvt, xterm as well as programs imitating one of those) will color the cleared area of the background using that color. less does use a few clearing operations, but not \x1b[2K. Reading the source, it ...
What reacts to the escape sequences is normally the tty (unless the running program sets it not to honor them, in which case the program itself may do so). more(1) does rather primitive screen rewriting (it is really enough to write out screen length lines, and wait for a keypress), so I'd guess it just passes input through. less(1) needs to back up, so it ...
EDIT The answers by vonbrand and Thomas Dickey are more technically accurate. less supports raw ANSI escapes when the -r option is used. It also supports Erase in line. You won't see any animation though. For example: echo -e "foo\x1b[1G\x1b[2Kbar" > test.ansi less -r test.ansi Will only print bar. more does pass on ANSI escapes by default but does ...
You have two options here. 1. You can set the MANLESS environment variable to what ever you need: export MANLESS=" " 2. You can add the -r option to your man command: man -r="" ls Both possibilities are described in the man manual page.
There is one single application whereby I prefer more to less: To check my LATEST modified log files (in /var/log/), I use ls -AltF | more. While 'less' deletes the screen after exiting with 'q', 'more' leaves those files and directories listed by 'ls' on the screen, sparing me memorizing their names for examination. (Should anybody know a parameter or ...
Originally I tried /\n, but the correct way to find end-of-lines is /$. (Remember, in regex ^ is the start of the line and $ the end, \n finds the n's.) In case you are navigating up, use ?^ instead, this skips to the start of the line.
Instead of setting the tab width in command line (before you open less). You can also set the tab width within less by typing -x4
The manual page, e.g, as you might find on OSX or Unix commands is incomplete: Among other things, less initializes itself using the termcap strings for the cursor keys, home/page keys, pageup/pagedown keys. In most configurations, it is also possible to override the termcap settings with environment variables beginning LESS_TERMCAP_, e.g., LESS_TERMCAP_ku ...
Probably not: the manual page for less does not mention wrapping, and the description of the search feature does not hint it is possible.
Top 50 recent answers are included