{"id":22064334,"url":"https://github.com/zimfw/prompt-pwd","last_synced_at":"2025-07-23T15:38:04.026Z","repository":{"id":108622482,"uuid":"400337344","full_name":"zimfw/prompt-pwd","owner":"zimfw","description":"Formats the current working directory to be used by prompts.","archived":false,"fork":false,"pushed_at":"2023-10-12T16:38:05.000Z","size":10,"stargazers_count":5,"open_issues_count":1,"forks_count":3,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-04-12T11:16:34.820Z","etag":null,"topics":["pwd","zim","zimfw","zsh","zsh-plugin","zsh-plugins","zsh-prompt"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/zimfw.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":"2021-08-27T00:01:56.000Z","updated_at":"2024-11-28T13:34:23.000Z","dependencies_parsed_at":"2025-02-04T21:33:35.998Z","dependency_job_id":"8247ac9a-a46d-4a57-bda3-5a33152e72cd","html_url":"https://github.com/zimfw/prompt-pwd","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimfw%2Fprompt-pwd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimfw%2Fprompt-pwd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimfw%2Fprompt-pwd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zimfw%2Fprompt-pwd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zimfw","download_url":"https://codeload.github.com/zimfw/prompt-pwd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248557847,"owners_count":21124168,"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":["pwd","zim","zimfw","zsh","zsh-plugin","zsh-plugins","zsh-prompt"],"created_at":"2024-11-30T19:04:08.100Z","updated_at":"2025-04-12T11:16:41.659Z","avatar_url":"https://github.com/zimfw.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"prompt-pwd\n==========\n\nFormats the path to the current working directory to be used by prompts.\n\nSettings\n--------\n\nUse the following zstyle to truncate the path to the git root when in a git repo:\n\n    zstyle ':zim:prompt-pwd' git-root yes\n\nTo truncate the number of trailing path components, use the following zstyle\nwith a positive value:\n\n    zstyle ':zim:prompt-pwd:tail' length \u003cvalue\u003e\n\nTo customize the maximum number of characters per path component, use:\n\n    zstyle ':zim:prompt-pwd:fish-style' dir-length \u003cvalue\u003e\n\nSetting the value to 0 will disable shortening entirely, which is the default\nbehavior.\n\nThe default path separator is `/` and it can be customized using:\n\n    zstyle ':zim:prompt-pwd:separator' format '\u003cformat\u003e'\n\nYou can include [prompt expansion escape sequences] in your custom separator\nformat.\n\nTheming\n-------\n\nAdd a call to the `prompt-pwd` function in your prompt code where you want the\ncurrent working directory to be displayed. Here's an example:\n\n```zsh\nsetopt nopromptbang prompt{cr,percent,sp,subst}\n\nzstyle ':zim:prompt-pwd' git-root yes\nzstyle ':zim:prompt-pwd:fish-style' dir-length 1\nzstyle ':zim:prompt-pwd:separator' format '❯'\n\nPS1='$(prompt-pwd)❯ '\n```\n\nIf you want to use `prompt-pwd` inside a function, call it passing the variable\nname you want it to set. A dummy example:\n```zsh\nprompt-pwd-len() {\n  local current_dir\n  prompt-pwd current_dir\n  print ${#current_dir}\n}\n```\n\n[prompt expansion escape sequences]: http://zsh.sourceforge.net/Doc/Release/Prompt-Expansion.html#Simple-Prompt-Escapes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimfw%2Fprompt-pwd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzimfw%2Fprompt-pwd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzimfw%2Fprompt-pwd/lists"}