[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Ranger-users] How to make preview wrap long lines?
From: |
Roman Z. |
Subject: |
Re: [Ranger-users] How to make preview wrap long lines? |
Date: |
Sun, 21 Oct 2012 22:25:37 +0200 |
User-agent: |
Mutt/1.5.21 (2010-09-15) |
On Thu, Sep 27, 2012 at 12:46:30PM -0700, epeyys wrote:
> I have struggled for a day and a night trying to make preview (pager) wrap
> long lines. From "Dependencies" section under http://nongnu.org/ranger, I
> got an impression that Ranger uses "less" for pager - "A pager (<a>less</a>
> by default)", but having changed the following lines inside
> $HOME/.config/ranger/apps.py to add an "N" after "R", which will make "less"
> display line number, has made no difference.
> def app_pager(self, c):
> return 'less', '-R', c
>
> By looking around codes under /usr/share/pyshared/ranger/, I guess Ranger
> default uses an embedded pager. So my question is how I can turn on wrap
> inside this default pager.
>
> There are two screenshots on Ranger's main websites, one shows wrap-enabled,
> one doesn't.
> No wrap: http://nongnu.org/ranger/screenshots/screenshot0.png
> Has wrap:
> http://download.savannah.gnu.org/releases-noredirect/ranger/screenshot2.png
This screenshot has no word wrapping.
>
> I am using Ubuntu 12.04, and Ranger version is "ranger 1.5.2 (stable)".
> Thank everyone for this great product.
You can wrap words by using scope.sh ("man ranger" and search for "scope").
A command like
fmt -s -w "$width"
does word wrapping, so you can simply pipe the text through it. If you
got the program "highlight", for example, then just replace the line
highlight --out-format=ansi "$path" | head -n $maxln
with
highlight --out-format=ansi "$path" | head -n $maxln | fmt -s -w "$width"
Regards,
hut