Giter Club home page Giter Club logo

ranger-quit_cd_wd's Introduction

Quit ranger then cd working directory

Description

Sometime you need to open a terminal on ranger working directory to do some jobs. Ranger provides S shortcut to do this, but I don't like this. And the quit command in ranger doesn't keep the working directory in ranger. So I make this plugin. I can also jump to my bookmarks (paths) in ranger quickly.

Installation

  1. Copy quit_cd_wd.py to ${XDG_CONFIG_HOME}/ranger/plugins.

    curl -fLo ${XDG_CONFIG_HOME:-~/.config}/ranger/plugins/quit_cd_wd.py --create-dirs \
            https://raw.githubusercontent.com/JohanChane/ranger-quit_cd_wd/main/quit_cd_wd.py
  2. Add the following mapping to the rc.conf

    map     x quit_cd_wd
    map     X quitall_cd_wd
    
  3. Add the following to your shell rcfile (e.g. .bashrc, .zshrc)

    function ranger_func {
        ranger $*
        local quit_cd_wd_file="$HOME/.ranger_quit_cd_wd"
        if [ -s "$quit_cd_wd_file" ]; then
            cd "$(cat $quit_cd_wd_file)"
            true > "$quit_cd_wd_file"
        fi
    }
    
    alias rn='ranger_func'

ranger-quit_cd_wd's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.