{"id":15507702,"url":"https://github.com/0phoff/gitmux","last_synced_at":"2025-04-23T01:59:07.515Z","repository":{"id":114521847,"uuid":"104117183","full_name":"0phoff/gitmux","owner":"0phoff","description":"git repository information in tmux environment variables","archived":false,"fork":false,"pushed_at":"2020-01-29T14:47:16.000Z","size":82,"stargazers_count":10,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T01:59:00.166Z","etag":null,"topics":["git","statusbar","tmux","tpm-plugin"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/0phoff.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2017-09-19T19:12:03.000Z","updated_at":"2025-01-26T21:38:13.000Z","dependencies_parsed_at":"2023-06-08T15:00:15.375Z","dependency_job_id":null,"html_url":"https://github.com/0phoff/gitmux","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/0phoff%2Fgitmux","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0phoff%2Fgitmux/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0phoff%2Fgitmux/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/0phoff%2Fgitmux/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/0phoff","download_url":"https://codeload.github.com/0phoff/gitmux/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250354300,"owners_count":21416751,"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":["git","statusbar","tmux","tpm-plugin"],"created_at":"2024-10-02T09:33:18.545Z","updated_at":"2025-04-23T01:59:07.508Z","avatar_url":"https://github.com/0phoff.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"GITMUX\n======\nThis tmux plugin sets some tmux environment variables with information about the current git repository.  \nIt is based of [tmux-gitbar](https://github.com/aurelien-rainone/tmux-gitbar), but gives the user more freedom to create his own statusbar with the variables.\n\n## Installation\nInstall this plugin with [tpm](https://github.com/tmux-plugins/tpm).\n  \u003e set -g @plugin '0phoff/gitmux'\n\n## Usage\n### Tmux\nIn your tmux config, you can use the following variables\n  - __GITMUX_SCRIPT__         : Path to the update script _(This is a global tmux variable, access it with tmux showenv -g)_\n  - __GITMUX_REPO__           : This value is non-zero if the current pane is in a git repository\n  - __GITMUX_BRANCH__         : Name of the current branch\n  - __GITMUX_REMOTE__         : Name of the tracking branch (0 if none)\n  - __GITMUX_COMMITS_AHEAD__  : Number of commits the current branch is ahead of the remote tracking branch\n  - __GITMUX_COMMITS_BEHIND__ : Number of commits the current branch is behind of the remote tracking branch\n  - __GITMUX_STAGED__         : Number of files that are staged for the next commit\n  - __GITMUX_CHANGED__        : Number of files that have changed since last commit (but not staged)\n  - __GITMUX_UNTRACKED__      : Number of untracked files\n  - __GITMUX_STASHED__        : Number of stashes\n  - __GITMUX_CONFLICTS__      : Number of files with conflicts\n  - __GITMUX_CLEAN__          : This value is 1 when there are no files untracked,changed or staged, no stashes and no conflicts\n\n### Vim\nIf you want to update your statusbar whenever you save a file in Vim, add the following line to your vim config:\n  \u003e autocmd BufWritePost * silent! !eval $(tmux display -p \"\\#{GITMUX_SCRIPT}\")\n\n### Neovim\nAlternative for neovim, that uses the jobcontrol feature to run the command asynchronously (and thus does not block the editor whilst running the command)\n  \u003e autocmd BufWritePost * silent! jobstart(['bash', '-c', 'eval $(tmux display -p \"\\#{GITMUX_SCRIPT}\")'])\n\n### Terminal\nIf you use the PROMPT_COMMAND variable in your terminal configuration, be sure to have it in this format:\n  \u003e PROMPT_COMMAND=\" …your_functions_here… ;$PROMPT_COMMAND\"\n\n__NOTE:__  \nSome distributions like ubuntu, reset the $PROMPT_COMMAND upon loading a terminal, which causes this plugin to fail.  \nIf the plugin does not seem to update when you enter a git repository check the files ``/etc/bash.bashrc`` and ``/etc/profile`` and all the files they source.  \nEg. for ubuntu, you need to comment out the following line, at the end of the file ``/etc/profile.d/vte-2.91.sh``:\n```bash\n[ -n \"$BASH_VERSION\" ] \u0026\u0026 PROMPT_COMMAND=\"__vte_prompt_command\"\n```\n\n## Examples\nHere is an example of how I use this plugin to show information on my status bar.\n```tmux\n# Shorted version, only important parts are shown\nset -g status-right '#{?GITMUX_REPO,#[fg=red]#{GITMUX_UNTRACKED} #[fg=yellow]#{GITMUX_CHANGED} #[fg=green]●#{GITMUX_STAGED} #[fg=white] #[fg=green]↑#{GITMUX_COMMITS_AHEAD} #[fg=red]↓#{GITMUX_COMMITS_BEHIND} #[fg=white] ⎇ #{GITMUX_BRANCH} , }'\n\n# Actual full version of the statusline I use\nset -g status-right '#{?GITMUX_REPO,#[fg=brightblack]#[bg=black]#[fg=white]#[bg=brightblack] #[fg=red]#{GITMUX_UNTRACKED} #[fg=yellow]#{GITMUX_CHANGED} #[fg=green]●#{GITMUX_STAGED} #[fg=white] #[fg=green]↑#{GITMUX_COMMITS_AHEAD} #[fg=red]↓#{GITMUX_COMMITS_BEHIND} #[fg=white] #{?GITMUX_REMOTE,⎇ #{GITMUX_BRANCH},#[fg=red]⎇ #[fg=white]#{GITMUX_BRANCH}} #[fg=black], }#[fg=blue,bg=black]#[fg=black,bg=blue] #U  #H '\n```\n![Screenshot](docs/example.png)\n\n## Contributing\nPlease report bugs and file issues with possible improvements.  \nIf you used this plugin, feel free to share the code and a screenshot of it, so I can add it to the README.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0phoff%2Fgitmux","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0phoff%2Fgitmux","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0phoff%2Fgitmux/lists"}