gsamokovarov / jump

Jump helps you navigate faster by learning your habits. ✌️
http://gsamokovarov.com/jump
MIT License
1.8k stars 59 forks source link

RangerFM integration #58

Closed mapperr closed 4 years ago

mapperr commented 4 years ago

Hi,

inspired by https://github.com/fdw/ranger-autojump I want to propose a jump ranger plugin that you can add to the jump README or to a jump wiki:

import ranger.api
import subprocess
from ranger.api.commands import *

class j(Command):
    """:j

    Uses jump to set the current directory.
    """

    def execute(self):
        directory = subprocess.check_output(["jump", "cd", self.arg(1)])
        directory = directory.decode("utf-8", "ignore")
        directory = directory.rstrip('\n')
        self.fm.execute_console("cd " + directory)

Just drop this jump.py in the ranger plugin directory and eventually add a keybinding like map cj console j%space to ranger's rc.conf and enjoy jumping from ranger.

gsamokovarov commented 4 years ago

Hey, thanks!

This was already requested and I have a quasi-supported ranger plugin at https://github.com/gsamokovarov/jump-ranger. Do you think it should be on jump's README? Is ranger popular around your circle?

gsamokovarov commented 4 years ago

I'll close this for now, please reopen the issue if the integration above does not work anymore.