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, 22 Sep 2014 04:17:30 -0400

Not sure if this is very useful for you, but I did.

I more frequently have to simply read a text file, rather than edit it.

That is why I would like the default action on a “left arrow” into the 3rd column to simply show the file in the $PAGER.

I added this to my $HOME/.config/ranger/rc.conf
(and the command to $HOME/.config/ranger/commands.py)

map P page %f

# This mapping requires the follwing code be added to $HOME/.config/ranger/commands.py

#class page(Command):
#    """:page <filename>
#
#    Opens the specified file in the $PAGER
#    """
#
#    def execute(self):
#        theFile = self.fm.thisFile.path
#        theCommand = "$PAGER " + theFile
#        call(theCommand, shell=True)
#
#    def tab(self):
#        return self._tab_directory_content()
#

Mike

reply via email to

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