{"id":13696685,"url":"https://github.com/JohanChane/ranger-quit_cd_wd","last_synced_at":"2025-05-03T17:31:50.203Z","repository":{"id":168948617,"uuid":"527903418","full_name":"JohanChane/ranger-quit_cd_wd","owner":"JohanChane","description":"Ranger plugin.","archived":false,"fork":false,"pushed_at":"2024-06-06T08:50:55.000Z","size":8,"stargazers_count":13,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-13T00:32:58.696Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JohanChane.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-23T08:40:50.000Z","updated_at":"2024-06-06T08:50:58.000Z","dependencies_parsed_at":"2024-03-14T16:31:18.692Z","dependency_job_id":"3f609df5-7268-45a0-9d5c-31352f83b645","html_url":"https://github.com/JohanChane/ranger-quit_cd_wd","commit_stats":null,"previous_names":["johanchane/ranger-quit_cd_wd"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohanChane%2Franger-quit_cd_wd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohanChane%2Franger-quit_cd_wd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohanChane%2Franger-quit_cd_wd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JohanChane%2Franger-quit_cd_wd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JohanChane","download_url":"https://codeload.github.com/JohanChane/ranger-quit_cd_wd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252226779,"owners_count":21714868,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T18:00:44.952Z","updated_at":"2025-05-03T17:31:49.898Z","avatar_url":"https://github.com/JohanChane.png","language":"Python","funding_links":[],"categories":["Plugins"],"sub_categories":[],"readme":"# Quit ranger then cd working directory\n\n## Description\n\nSometime 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.\n\n## Installation\n\n1.  Copy `quit_cd_wd.py` to `${XDG_CONFIG_HOME}/ranger/plugins`.\n\n    ```sh\n    curl -fLo ${XDG_CONFIG_HOME:-~/.config}/ranger/plugins/quit_cd_wd.py --create-dirs \\\n            https://raw.githubusercontent.com/JohanChane/ranger-quit_cd_wd/main/quit_cd_wd.py\n    ```\n\n2.  [optional] Add the following mapping to the `rc.conf`\n\n    ```\n    # Equivalent to `map X quitall_cd_wd ~/.cache/ranger/quit_cd_wd`\n    map     X quitall_cd_wd\n    # OR customize the path\n    map     X quitall_cd_wd \u003cfile_saved_wd\u003e\n    ```\n\n3.  Add the following to your shell rcfile (e.g. `.bashrc, .zshrc`)\n\n    ```sh\n    function ranger {\n      local quit_cd_wd_file=\"$HOME/.cache/ranger/quit_cd_wd\"        # The path must be the same as \u003cfile_saved_wd\u003e in map.\n      #command ranger \"$@\"              # If you have already added the map to rc.conf\n      # OR add `map X quitall_cd_wd ...` if you don't want to add the map in rc.conf\n      command ranger --cmd=\"map X quitall_cd_wd $quit_cd_wd_file\" \"$@\"\n      if [ -s \"$quit_cd_wd_file\" ]; then\n        cd \"$(cat $quit_cd_wd_file)\"\n        true \u003e \"$quit_cd_wd_file\"\n      fi\n    }\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJohanChane%2Franger-quit_cd_wd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FJohanChane%2Franger-quit_cd_wd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FJohanChane%2Franger-quit_cd_wd/lists"}