NameSizeMode
..
.config/ranger/commands.py 487 bytes ?rw-r--r--
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
18
19
from ranger.api.commands import Command
from os.path import join, expanduser

class rename(Command):
    """:rename <destination>

    Renames a file
    """

    def execute(self):
        source = self.fm.thisfile
        destination = join(self.fm.thisdir.path, expanduser(self.rest(1)))
        destination = destination.strip()

        if destination:
            self.fm.run("mv '%s' '%s'" % (source, destination))
        else:
            self.fm.notify("Cancelled", bad=True)