Skip to content

chrisgrieser/zsh-magic-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zsh-magic-dashboard

Pressing enter on an empty buffer displays an information-rich and pretty dashboard.

Showcase

  • Top: Recent commits (git log)
  • Center: Current Status (hybrid of git status and git diff --stat)
  • Bottom: Files in the current directory (via eza)

Empty components, such as git status in a clean repo, are automatically hidden.

Table of contents

Installation

Requirements

  • eza
  • Nerdfont
  • Optional: A terminal that supports OSC8 for hashes and issues to be clickable.

Manual

Clone the repository somewhere on your machine. This manual assumes you are using ~/.zsh/.

cd ~/.zsh/ # where to install the plugin
git clone https://github.com/chrisgrieser/zsh-magic-dashboard

Add the following to your ~/.zshrc:

source ~/.zsh/zsh-magic-dashboard/magic_dashboard.zsh

oh-my-zsh

Clone this repository into $ZSH_CUSTOM/plugins (by default ~/.oh-my-zsh/custom/plugins)

git clone https://github.com/chrisgrieser/zsh-magic-dashboard ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-magic-dashboard

Add the plugin to the list of plugins for oh-my-zsh to load (inside ~/.zshrc):

plugins=( 
    # other plugins...
    zsh-magic-dashboard
)

Start a new terminal session.

source ~/.zshrc

Configuration

Export these variables in your ~/.zshrc. The values displayed are the defaults.

export MAGIC_DASHBOARD_GITLOG_LINES=5
export MAGIC_DASHBOARD_FILES_LINES=6
export MAGIC_DASHBOARD_FILES_LINES=4
export MAGIC_DASHBOARD_DISABLED_BELOW_TERM_HEIGHT=15

Usage

Press enter on an empty buffer. That's it!

Display dashboard on cd

The dashboard call also be called via _magic_dashboard. One use case would be to modify your cd command to display the dashboard after the directory change.

function cd {
	builtin cd "$@" && _magic_dashboard
}

Credits

This plugin is based on Magic Enter by @dufferzafar.

In my day job, I am a sociologist studying the social mechanisms underlying the digital economy. For my PhD project, I investigate the governance of the app economy and how software ecosystems manage the tension between innovation and compatibility. If you are interested in this subject, feel free to get in touch.

If you find this project helpful, you can support me via 🩷 GitHub Sponsors.

About

Pressing "enter" on an empty buffer displays an information-rich and pretty dashboard.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors