The Tmux LazyGit plugin provide a quick and easy way to open or toggle a LazyGit window for the current folder within your tmux session.
Press prefix
+ g
to switch to LazyGit widnow, press again to switch back.
Add the Tmux LazyGit plugin to your list of tpm
plugins in .tmux.conf
:
set -g @plugin 'Nybkox/tmux-lazygit'
Press prefix
+ I
inside a tmux
session to fetch the plugin and source it.
Once installed, the plugin automatically sets up a keybinding for toggling the LazyGit window, provided the default keybindings are not disabled in the configuration.
prefix+g
: Toggle the LazyGit window in the current session.
These keybindings can be customized in the .tmux.conf
file.
Customize the plugin behavior by setting options in your .tmux.conf
file:
Disable default keybindings:
set -g @tmux-lazygit-default-keybindings "false"
Set custom keybinding for toggling LazyGit window:
set -g @tmux-lazygit-toggle-window-key "your_custom_key"
Set custom name for LazyGit window:
set -g @@tmux-lazygit-window-name "your_custom_name"
You may need to manually give permission to the plugin's scripts:
cd ~/.tmux/plugins/tmux-lazygit
chmod u+x tmux-lazygit-plugin.tmux
chmod u+x ./**/*.sh