ranger-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ranger-users] Page command


From: Michael Longval
Subject: [Ranger-users] Page command
Date: Mon, 20 Apr 2015 12:52:45 -0400
User-agent: Mutt/1.5.23 (2014-03-12)

Hi, 

I added a "page" command because "selecting" a text or .py file always
opens it. I don't always want that. 

Here is the rc.conf part:

map pp page %f

and this is the commands.py part:

(
Now I've been using this for a while now, and I don't recall if I
modified what was already there, or if I added this myself, anyway 
this simply pages the file to 'less'
)

Also this is very MacOSX specific because I assume that people are using
HOMEBREW.


class page(Command):
    """:page <filename>

    Opens the specified file in 'less'
    """

    def execute(self):
        theFile = self.fm.thisfile.path
        theCommand = "/usr/bin/clear;/usr/local/bin/less '" + theFile +"'"    # 
this ASSUMES using HOMEBREW
        call(theCommand, shell=True)
        self.fm.ui.redraw_window()
        self.fm.ui.initialize()


Hope it's usefull,

Mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]