Skip to content

kechol/tmux-git-status

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tmux git status

tmux-git-status is a tmux plugin that enables displaying git status on your tmux status line.

tmux_git_status

Installation

Installation with Tmux Plugin Manager (recommended)

Add plugin to the list of TPM plugins in .tmux.conf:

set -g @plugin 'kechol/tmux-git-status'

Manual Installation

Clone the repo anywhere you want:

$ git clone https://github.com/kechol/tmux-git-status ~/.tmux-git-status

Add this line to the bottom of .tmux.conf:

run-shell ~/.tmux-git-status/git_status.tmux

Reload TMUX environment:

# type this in terminal
$ tmux source-file ~/.tmux.conf

Usage

Basic Usage

Add #{git_branch}, #{git_upstream} or #{git_status} format string to your existing status-right tmux option.

Here's the example in .tmux.conf:

set -g status-interval 1
set -g status-right-length 100
set -g status-right "#{git_branch} #{git_upstream} #{git_status} | %a %h-%d %H:%M"

Please set status-interval short to keep update the git info. Also, you may need to set status-right-length long enough.

Configuration

There are some options to custom looks as you like.

set -g @git_status_branch_format '#[fg=red]' # default: '#[fg=white]'
set -g @git_status_upstream_format '#[fg=red]' # default: '#[fg=yellow]'
set -g @git_status_dirty_status_format '#[fg=red]' # default: '#[fg=yellow]'
set -g @git_status_default_status_format '#[fg=black]' # default: '#[fg=white]'
set -g @git_status_status_delimiter '|' # default: ':'
set -g @git_status_ahead_symbol '' # default: '+'
set -g @git_status_behind_symbol '' # default: '-'

Credits

Take inspiration from:

Other credits:

License

MIT